Iraqi PM Haider al-Abadi has visited Mosul to congratulate Iraqi forces for their “victory” over IS in the city.
Mr Abadi was there to announce the city’s full “liberation”, 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 gruelling 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.
He met commanders in the city but has not yet given a speech formally declaring triumph.
Iraqi forces have been battling the remaining pockets of jihadists desperately holding out in a tiny area near the Old City.
Airstrikes and exchanges of gunfire could still be heard on Sunday, and plumes of smoke seen rising into the sky.
Mr Abadi’s spokesman, Saad al-Hadithi, said victory would not be formally declared until the few remaining militants were cleared from Mosul, Reuters news agency reports.
Earlier 30 IS fighters were killed as they attempted to escape the advance of the Iraqi forces by throwing themselves in the River Tigris, state media said.