With the jihadists surrounded in a sliver of territory in Mosul's Old City, attention was turning to the huge task of rebuilding the city and of helping civilians, with aid groups warning that Iraq's humanitarian crisis was far from over.
Prime Minister Haider al-Abadi visited Mosul on Sunday and hailed Iraq's "heroic fighting forces" after months of difficult battles that have left much of the city in ruins.
The Old City in particular has been devastated, with many buildings reduced to little more than concrete shells and rubble littering the streets.
Upon his arrival in the city, Abadi's office said he was visiting "liberated" Mosul to congratulate troops on a "major victory".
Abadi later said that while "victory is certain", he was holding off on making a formal declaration "out of my respect and appreciation for our... forces that are continuing the clearing operation."
A senior commander said on Monday that Iraqi forces were engaged in "heavy" fighting with the remnants of jihadist forces, but that the battle was near its end.
Lieutenant General Sami al-Aridhi of the elite Counter-Terrorism Service said the jihadists had been reduced to an area of the Old City of about 200 by 100 metres (yards).
But "operations are in their final stages," and "it is likely that (the fighting) will end today", Aridhi said.
Aridhi said his forces had information that there were between 3,000 and 4,000 civilians in the area but that could not be independently confirmed.
Backed by the US-led coalition battling IS, Iraqi forces launched their campaign in October to retake Mosul, which was seized by the jihadists during the mid-2014 offensive that saw them take control of large parts of Iraq and neighbouring Syria.
Army, police and special forces, backed by waves of US-led air strikes, seized the eastern side of the city in January and launched the battle for its western part the next month.
The fight grew tougher when security forces entered the densely populated Old City on the western bank of the Tigris River, which divides the city, and intense street-to-street fighting followed.
The cost of victory has been enormous: much of Mosul in ruins, thousands dead and wounded and nearly half the city's population forced from their homes.
The United Nations has said 920,000 people fled their homes during the Mosul operation, and while some have returned the vast majority remain displaced.
"It's a relief to know that the military campaign in Mosul is ending. The fighting may be over, but the humanitarian crisis is not," Lise Grande, the UN's humanitarian coordinator in Iraq, said in a statement.
The UN refugee agency (UNHCR) on Monday said it could be many months before civilians are able to return to their homes.
"It is likely that thousands of people may have to remain in displacement for months to come," UNHCR said in a statement.
"Many have nothing to go back to due to extensive damage caused during the conflict, while key basic services such as water, electricity and other key infrastructure, including schools and hospitals, will need to be rebuilt or repaired," it said.
Twenty-eight aid groups working in Iraq issued a statement calling for international support for rebuilding efforts and urged authorities not to press civilians to return.
"Remaining insecurity; lack of basic services; explosive hazards contamination; and damage to homes, businesses and public infrastructure -- including schools and hospitals -- all continue to pose barriers to return," said the statement signed by groups including the Norwegian Refugee Council, Oxfam and Save the Children.
It also raised concerns for Iraqis still in areas under IS control, including the towns of Tal Afar and Hawijah in the north, as well as territory in western Anbar province.
"For the expected offensives in Hawijah, Tal Afar and western Anbar, where approximately 150,000 civilians are thought to still be trapped, it is vital that lessons are learnt from pass offensives," the aid groups said, calling for access to safety and assistance to be prioritised.
France, Britain and the European Union congratulated Iraqi forces on Sunday, with the EU hailing "a decisive step in the campaign to eliminate terrorist control in parts of Iraq".
Iran, a key ally of Abadi's Shiite-led government, gave its congratulations too and offered help in rebuilding.
"The government, armed forces and the brave nation of Islamic Iran... are prepared to offer aid to the displaced and injured in the war and help rebuild the cities and vital infrastructure in the country," official news agency IRNA quoted Ali Shamkhani, secretary of Iran's Supreme National Security Council, as saying.
IS has lost most of the territory it once controlled, and the coalition is also aiming to oust the jihadists from their Syrian stronghold Raqa, which is under assault by US-backed Arab and Kurdish forces.