U.S. Defense Secretary Jim Mattis visited Iraq on Tuesday just days after the start of an offensive to oust IS from the city of Tal Afar, with talks focused on backing Iraqi efforts to stabilise areas recaptured from the militant group. Prior to arriving, Mattis said the fight against IS was far from over despite recent successes by Western-backed Iraqi government forces. The battle for Tal Afar would be difficult, U.S. officials said. Iraqi security forces opened the offensive to take back Tal Afar on Sunday, their latest objective in the war following the recapture of Mosul after a nine-month campaign that left much of the city in ruins. Lying 80 km (50 miles) west of Mosul in Iraq's far north, Tal Afar is a long-time stronghold of the hardline Sunni Muslim insurgents, "ISIS' days are certainly numbered, but it is not over yet and it is not going to be over anytime soon," Mattis told reporters in Amman. Mattis said that after retaking Tal Afar, Iraqi forces would move against the western Euphrates River valley. Brigadier General Andrew Croft, responsible for coalition air operations over Iraq, said that between 10,000 and 20,000 civilians remained in Tal Afar. The plight of civilians was a big factor in the battle of Mosul as IS tried to keep them areas it controlled to act as human shields against air strikes and artillery bombardments. Several thousand are believed to have been killed. Croft said that over the past two or three months, he had seen a fracturing in IS leadership. "It just seems less coordinated. It appears more fractured, less robust, and sort of flimsy, is the word I would use...it is sporadic," Croft told reporters. IS leaders fled Mosul during the fighting there and the whereabouts of its chief, Abu Bakr al-Baghdadi, are unknown. Unconfirmed reports in the past few months have said he is dead. Popular Mobilization Forces (PMF) fire against IS militants on the outskirts of Tal Afar, Iraq. REUTERS Brett McGurk, U.S. special envoy to the coalition, said that while the battle for Tal Afar would be difficult, Iraqi forces had retaken 235 square km (90 miles) in the first 24 hours. U.S. officials, speaking on the condition of anonymity, said Mattis, who will meet Prime Minister Haider al-Abadi and Defence Minister Arfan al-Hayali, will discuss the future of U.S. forces in Iraq after the recapture of the remaining cities under IS, and the role they could play in stabilizing operations. The officials said that while big cities like Mosul have been largely been cleared of IS militants, there were concerns about the ability of Iraqi forces to hold territory. Mattis said pockets of resistance remained in west Mosul, including sleeper cells. Iraqi security forces were capable of carrying out simultaneous operations, he added. IS is also on the back foot in Syria, where Kurdish and Arab militias backed by the U.S.-led coalition have captured swathes of its territory in the north and are assaulting its main Syrian stronghold of Raqqa. McGurk said about 2,000 IS fighters remained in Raqqa and as much as 60 percent of the city had been retaken. The jihadist group is now falling back deeper into the Euphrates valley region of eastern Syria. Mattis said the next step for forces fighting IS in Syria would be a move against the middle Euphrates valley, a reference to the militants' stronghold in Deir al-Zor province southeast of Raqqa. KURDISH REFERENDUM A U.S. official also said Mattis would press Massoud Barzani, president of the autonomous Kurdistan Regional Government, to call off a planned referendum on independence. Iraq's Kurds have said they will hold the referendum on Sept. 25 despite concerns from Iraq's neighbors who have Kurdish minorities within their borders and a U.S. request to postpone it. However, a senior Kurdish official said the Kurds may consider the possibility of a postponment in return for financial and political concessions from the central government in Baghdad. McGurk said the Kurdish delegation's recent visit to Baghdad was encouraging. The Pentagon signed an agreement with Peshmerga forces last year to provide hundreds of millions of dollars in weapons and equipment. The U.S. official, speaking on the condition of anonymity, said that the memorandum of understanding would expire soon and suggested that Mattis could use it as a bargaining chip. The United States and other Western nations fear the vote could ignite a new conflict with Baghdad and possibly neighboring countries, diverting attention from the ongoing war against IS militants in Iraq and Syria.