Iraqi Prime Minister Haider al Abadi arrived in Mosul on Sunday and congratulated the armed forces for a "victory" over Daesh after eight months of urban warfare.
Daesh's defeat in Mosul three years after taking the city is a major blow for the group, that is also losing ground in its operational base in the Syrian city of Raqqa.
The battle has left large parts of Mosul in ruins, killed thousands of civilians and displaced nearly one million people.
"The commander in chief of the armed forces (Prime Minister) Haider al Abadi arrived in the liberated city of Mosul and congratulated the heroic fighters and Iraqi people for the great victory," his office said in a statement.
TRT World’s Sarah Jones reports.
French President Emmanuel Macron, whose country is also a part of the international coalition which backed the campaign with airstrikes, training and assistance on the battlefield, welcomed the defeat of Daesh in Mosul.
"Mosul liberated from ISIS (Daesh): France pays homage to all those, who alongside our troops, contributed to this victory," Macron said on his Twitter account.
The decaying corpses of militants lay in the narrow streets of the Old City where Daesh has staged a last stand against Iraqi forces backed by a US-led coalition.
The group vowed to "fight to the death" in Mosul, but Iraqi military spokesman Brigadier General Yahya Rasool told state TV earlier on Sunday that 30 militants had been killed attempting to escape by swimming across the River Tigris that bisects the city.
Cornered in a shrinking area, the militants have resorted to sending women suicide bombers among the thousands of civilians who are emerging from the battlefield wounded, malnourished and fearful.
Heavy toll on Iraqi forces
The battle has also exacted a heavy toll on Iraq's security forces.
The Iraqi government does not reveal casualty figures, but a funding request from the US Department of Defense said the elite Counter Terrorism Service, which has spearheaded the fight in Mosul, had suffered 40 percent losses.
The US leads an international coalition that is backing the campaign against Daesh in Mosul by conducting airstrikes against the militants and assisting troops on the ground.
The Department of Defense has requested $1.269 billion in US budget funds for 2018 to continue supporting Iraqi forces.
Without Mosul - by far the largest city to fall under the group's control - Daesh's dominion in Iraq will be reduced to mainly rural, desert areas west and south of the city where tens of thousands of people live.
It is almost exactly three years since the terrorist group's leader Abu Bakr al-Baghdadi proclaimed a "caliphate" spanning Syria and Iraq from the pulpit of the medieval Grand al-Nuri mosque.
Abadi declared the end of Daesh's "state of falsehood" a week ago, after security forces retook the mosque - although only after retreating militants blew it up.
The UN predicts it will cost more than $1 billion to repair basic infrastructure in Mosul.
In some of the worst affected areas, almost no buildings appear to have escaped damage and Mosul's dense construction means the extent of the devastation might be underestimated, UN officials said.
Daesh fighters are expected to revert to insurgent tactics as they lose territory.
The fall of Mosul also exposes ethnic and sectarian fractures between Arabs and Kurds over disputed territories or between Sunnis and the Shia majority that have plagued Iraq for more than a decade.