IRAQI troops have celebrated after driving Daesh militants from some of their last strongholds in Mosul, but heavy fighting continued a few blocks away.

Lieutenant General Jassim Nizal of the army's 9th Division said his forces had achieved "victory" in their sector, after a similar announcement by the militarised Federal Police.

His soldiers danced to patriotic music on tanks even as air strikes sent plumes of smoke into the air nearby.

Iraqi state TV reported that Prime Minister Haider al-Abadi had arrived in the city to declare victory over Daesh after an eight-month operation to drive the militants out of the city.

State TV quoted al-Abadi as saying he "congratulates the fighters and the people on the big victory" in the key city, even as fighting continued in a small sector in the city.

Iraq launched the operation to retake Mosul in October. Daesh now controls less than a square kilometre of territory in the Old City, but is using human shields, suicide bombers and snipers in a fight to the death.

The militants captured Iraq's second largest city in a matter of days in the summer of 2014. Lt Gen Nizal acknowledged that many of his men were among those who fled the city at that time in a humiliating defeat for the country's armed forces.

"Some things happened here, that's true," he said. "But we have come back."

Much of Mosul's Old City and surrounding areas have been devastated by months of gruelling urban combat. On Sunday a line of tired civilians filed out of the Old City on foot, past destroyed apartment blocks lining the cratered roads.

The loss of the city would mark a major defeat for IS, which has suffered a series of major setbacks over the past year.