US defence secretary James Mattis arrived in Baghdad on Tuesday in an unannounced visit to show American support for Iraqi forces as they pressed an assault on Tal Afar.
Mr Mattis arrived in the Iraqi capital just hours after President Donald Trump outlined a fresh approach to the stalemated war in Afghanistan.
Before heading into meetings with Iraqi prime minister Haider Al Abadi and other top officials, Mr Mattis, himself a retired general, said he wanted to keep the spotlight on combating ISIL,
"Right now our focus is on defeating ISIL inside Iraq, restoring Iraqi sovereignty and territorial integrity," he said.
In a statement from his office, Mr Al Abadi said the ministers discussed enhancing a joint military co-operation and the war against terrorism. Mr Mattis reiterated US military support and praised the victory of Iraqi forces in Mosul, but rejected any "action aimed at dividing and destabilising Iraqi's integral unity".
Iraqi ground troops backed by the US launched an offensive on Sunday to recapture Tal Afar, once a key ISIL supply hub between Mosul and the Syrian border. Driven from their main stronghold in northern Iraq, ISIL militants are now trapped in a "military vice" that will squeeze them on both sides of the Syria-Iraq border, Mr Mattis said.
"The assault was launched on the city itself," said Ahmed Al Assadi, spokesman for the Hashed Al Shaabi, the Shiite militia that has been fighting ISIL alongside government forces.
Units of the Hashed Al Shaabi, army and police had encircled the city despite strong resistance from ISIL from within the city, Mr Al Assadi said. He said the fighting for the city was likely to last weeks. Mr Mattis declined to make any predictions on the battle.
"ISIL's days are certainly numbered, but it's not over yet and it's not going to be over anytime soon," he said.
Mohammed Hineidi, a senior analyst at the Abu Dhabi-based Delma Institute, said, "There are roughly 2,000 battle hardened fighters with their families left in Tal Afar, and despite being fatigued from years of fighting — they will likely fight to their last breath. The city is however quite small, and the battle will likely be over by the end of September/mid October — although it is difficult to forecast exactly when."
Mr Mattis said his discussions in Iraq would focus on the way ahead, including how to keep the country from again politically fragmenting or falling further under Iran's influence.
The US defence secretary also travelled on to Erbil to meet Massoud Barzani, president of Iraqi Kurdistan. Mr Mattis was expected to ask Mr Barzani to call off the Kurdistan Region’s planned independence referendum next month. He said he would also discuss reconstruction and resettlement of hundreds of thousand of Iraqis driven from their homes and towns by the fighting, especially in Mosul.
"It's not going to happen overnight. It's going to be a heavy lift for them going forward," he said.
Mr Mattis arrived in Iraq from Jordan where he said the so-called Middle Euphrates River Valley, which bisects Iraq and Syria roughly from the western Iraqi city of Al Qaim to the eastern Syrian city of Der Al Zour will be liberated in time. he referred to the area as "ISIL's last stand."
Meanwhile, Iraqi forces announced on Tuesday they have retaken two districts of Tal Afar from ISIL.
Army, police and units of the Hashed Al Shaabi were now in "full control" of Al Kifaf and Al Nur districts, held by ISIL since 2014, the Hashed militia said in a statement.
"The advancing troops didn't face tough resistance from ISIL fighters, though they did fire rockets, sent suicide car bombers and used roadside bombs," said Brigadier-General Haider Fadhil, of the Iraqi special forces. He said he expected the fighting to get "even heavier as they push into the town's centre" about 4.5 kilometres away.
Unlike the war in Afghanistan, Iraq offers a more positive narrative for the White House, at least for now. Having enabled Iraqi government forces to reclaim ISIL's prized possession of Mosul in July, the US military effort is showing tangible progress and the Pentagon can credibly assert that momentum is on Iraq's side.