Iraq declared victory against the Islamic State group in Mosul on Sunday after a gruelling months-long campaign, dealing the biggest defeat yet to the jihadist group.
Iraqi Prime Minister Haider al-Abadi's office said he was in "liberated" Mosul to congratulate "the heroic fighters and the Iraqi people on the achievement of the major victory".
The announcement comes after months of heavy fighting that have left Iraq's second city in ruins and forced tens of thousands from their homes.
The fighting did not seem to be completely over, with gunfire still audible in Mosul and air strikes hitting the city around the time the premier's office released its statement.
But Abadi's arrival had been expected for days as a signal of the end of the battle for the city.
#URGENT Iraqi Prime Minister Haider al-Abadi declares victory in the "liberated" city of Mosul https://t.co/nR2X9hDcg5 pic.twitter.com/4SmVR6iDDI — AFP news agency (@AFP) July 9, 2017
But the fight grew tougher when Iraqi forces entered the densely populated Old City on the western bank of the Tigris River that divides the city.
In recent days, security forces have killed jihadists trying to escape their dwindling foothold in Mosul, as Iraqi units fought to retake the last two IS-held areas near the Tigris.
Earlier Sunday Iraq's Joint Operations Command had said it killed "30 terrorists" trying to escape across the river.
Even in the final days of the battle, thousands of civilians remained trapped inside the Old City and those who fled arrived grief-stricken after losing relatives in jihadist sniper fire and bombardments.
Around 915,000 residents have fled Mosul since the start of the battle for the city in October, the United Nations said this week.