Iraqi PM Haider al-Abadi has arrived in Mosul to congratulate Iraqi forces for their victory over IS in the city.
Mr Abadi was in the city to announce its “liberation” and declare “victory”, his office said in a statement.
Iraqi forces, backed by US-led air strikes, have been battling to retake Mosul since 17 October last year.
Islamic State militants seized it in June 2014 before taking much of Iraq’s Sunni Arab heartland and proclaiming a “caliphate” straddling Iraq and Syria.
Kurdish Peshmerga fighters, Sunni Arab tribesmen and Shia militiamen have also been involved in the battle.
The Iraqi prime minister arrived to “congratulate the armed forces and the Iraqi people” on the final defeat of IS in Mosul on Sunday, the statement said. An official speech is expected soon.
Iraqi forces have been battling the remaining pockets of jihadists desperately holding out in a tiny area near the Old City.
- Battle for Mosul: The story so far
- Where is ‘Islamic State’ leader Abu Bakr al-Baghdadi?
- Survivors hang on as Iraqi forces close in
Sporadic bursts of gunfire could still be heard on Sunday, and plumes of smoke rose into the sky.
Thirty IS militants were killed as they attempted to escape the advance of the Iraqi forces by throwing themselves in the River Tigris, state media said.
The government announced the full “liberation” of eastern Mosul in January, but the west of the city, with its narrow, winding streets, has presented a more difficult challenge.
Some 900,000 people have been displaced from the city since 2014 – about half the the pre-war population – aid organisations say.
The Islamic State group has lost large parts of the territory it once controlled in Iraq since the regional offensive began.
But correspondents say the fall of Mosul does not mean the end of IS in the country, as it still has territory areas elsewhere and is able to carry out bombings in government-held areas.