BAGHDAD — (Associated Press) Defense Secretary Ash Carter arrived in Iraq on Saturday to meet with his commanders and assess the progress in the opening days of the operation to retake the northern city of Mosul from Islamic State militants.

His visit comes two days after a U.S. service member was killed outside Mosul, underscoring the risk that American troops are taking as they advise Iraqi forces in the fight. The trip also follows meetings that Carter held with Turkish leaders on Friday, when he announced “an agreement in principle” for Turkey to play a role in the Mosul battle, and that friction between Turkey and Iraq can be worked out.

Carter, who already has been to Iraq twice this year, has overseen the steady increase in the number of U.S. forces deployed to the fight and the growth of America’s effort to train and advise Iraqi troops. In his two earlier visits, Carter announced White House decisions to increase the U.S. troop level there. There were no expectations he would do that again.

Instead, he planned to meet with Iraqi leaders and military commanders to determine how the fight was going and whether any changes, increased resources or other assistance were needed.

Carter’s meetings in Turkey were a sign of moves to ease tensions between Turkey and Iraq over Turkish military operations in northern Iraq. That divide has grown as the operation to retake Mosul began to take shape.

Some 500 Turkish troops at a base north of Mosul have been training Sunni and Kurdish fighters since last December. The Iraqi government says the troops are there without permission and has called on them to withdraw. Turkey has refused, and insists it will play a role in liberating the city.

The U.S. service member killed this week was the fourth U.S. combat death in Iraq since the U.S. began military operations against IS in August 2014. It was the first since the Mosul operation began, and the service member was working with Iraqi special forces northeast of Mosul and serving as an explosive ordnance disposal specialist.

U.S. military officials said a fire at a sulfur plant in northern Iraq set by IS on Thursday was creating a potential breathing hazard for American forces and other troops at a logistical base south of Mosul.

Two officials said that while the fire was set two days ago in Mishraq, the winds shifted Saturday, sending the smoke south toward Qayara West air field. The base is being used by troops as a staging area for the Mosul operation. The officials spoke on condition of anonymity because they were not authorized to discuss the matter publicly.

They said troops at the base were wearing protective masks, and that air samples were sent to the U.S. Defense Threat Reduction Agency for analysis. Officials estimated it could take two to three days to put the fire out.

U.S. defense and military officials have said that while the offensive has started well, they expect the complex fight for the city to get more difficult. They said they will be watching to see how aggressively the militants fight and whether more leaders flee the city.

In what officials thought was an attempted diversion from the Mosul fight, IS attacked targets in and around the northern Iraqi city of Kirkuk on Friday in a coordinated assault that killed at least 14 people.

Carter was expected to meet with Iraqi Prime Minister Haider al-Abadi as well as other top officials.

A U.S. military officer said IS had set up a multilayered defense in and around Mosul. The outer rings of this defense are what the U.S. military calls disruption zones, where IS fighters are expected to counter the Iraqi advance through the use of mortars and rockets, suicide bombers, road obstacles and car bombs.

The official said the U.S. does not expect this to include high-intensity force-on-force combat in these outer rings. The expected IS focus will be on disrupting and delaying the Iraqi advance rather than trying to hold ground outside the city. The official was not authorized to discuss the matter publicly and spoke on condition of anonymity.

The U.S. estimates there are between 3,000 and 5,000 IS fighters in the Mosul area, but some leaders probably have fled. A key factor will be how long those midlevel commanders stay or whether they decide to leave.

The U.S. is uncertain how hard IS will defend Mosul. But once the fighting gets to the center of the city, IS will have certain advantages that are more favorable for the use of snipers and the restriction of vehicle movement.

More than 4,800 U.S. troops are in Iraq and there are more than 100 U.S. special operations forces operating with Iraqi units. Hundreds more U.S. forces are playing a support role in staging bases farther from the front lines.