Iraqi forces battled the last Islamic State of Iraq and the Levant (ISIL) fighters in Tikrit to seal a victory the government described as a milestone in efforts to rid the country of armed group.
Iraqi fighters picked their way through the rubble-strewn streets of the city on Wednesday, wary of any last-ditch attack from ISIL fighters and of the thousands of bombs they left behind.
A major military push saw Iraqi police and allied forces retake the city centre on Tuesday but pockets of jihadist militants remained.
A top leader in the Badr organisation, one of the most prominent Shia militias in Iraq, admitted that Tikrit had not been completely purged of ISIL fighters.
"Snipers are still there and many buildings are booby-trapped," Karim al-Nuri told AFP news agency in the northern Tikrit neighbourhood of Qadisiya.
A commander for the Ketaeb Imam Ali militia said his men were involved in a firefight in the north of the city as late as 11:00am (0800 GMT).
They "tried to advance on the university," Rasul al-Abadi told AFP, adding that there were "no more than 30" ISIL fighters left in the city's vast northern district of Qadisiya.
"The Iraqi security forces control 95 percent of the city, there are sporadic clashes," said an army lieutenant colonel from Salaheddin province, of which Tikrit is the capital.
An official from the governor's office said municipal teams were already at work in some reconquered neighbourhoods, cleaning debris and restoring power.
On Tuesday, Prime Minister Haider al-Abaddi claimed the city was liberated but the US-led coalition that has been helping Baghdad from the air said there was "still work to be done".
After fighters replaced the black ISIL flag on the provincial headquarters with Iraq's tricolour on Tuesday, Abaddi hailed the reconquest of Tikrit as a "historic milestone".
A paramilitary commander said ISIL fighters launched an attack from a mountain hideout northeast of Tikrit on Wednesday in an attempt to open a safe passage to the town of Hawija for fleeing fighters.
Iraq's top brass was already training its sights on Mosul, which fighters seized from the government at the same time as Tikrit in June last year.
"This victory is only a new starting point from which to launch the operation to liberate Nineveh province," the defence ministry said Tuesday after a meeting of top commanders.
The loss of Tikrit further isolates the main ISIL hub of Mosul, with Baghdad's forces now set to push north while Kurdish forces close in from the three other directions.
Zaid al-Ali, author of "The Struggle For Iraq's Future", said however that the fighting in Tikrit was made easier by the fact that the city was largely emptied of its population even before the operation began on March 2.
"Mosul still has a large civilian population, which will make things very complicated," the analyst said.