The Iraqi government has declared a “magnificent victory” over Islamic State militants in the city of Tikrit.
Troops are still fighting to clear the last remaining IS holdout in the city, but Prime Minister Haider al-Abadi was filmed raising an Iraqi flag there.
The month-long operation to recapture Tikrit has been the biggest launched yet by the government against IS.
It stalled for a time, but was given fresh momentum when the US-led coalition began air strikes last week.
The army says it regards Tikrit’s recapture as a key stage before it tries to retake Iraq’s second city, Mosul, and drive IS out of the country altogether.
On Wednesday, state television broadcast pictures showing Mr Abadi, army and police commanders, Shia militia leaders and the governor of Salahuddin province walking through Tikrit.
The Reuters news agency said explosions and gunfire could be heard as Interior Minister Mohammed al-Ghabban told reporters: “Most of Tikrit today is liberated, only small parts remain [outside our control].”
Troops were trying to clear the northern district of Qadisiya, and were also working to remove mines and bombs from recaptured areas, Mr Ghabban said.
“We will reopen police stations to restore normalcy in the city, and we will form committees to supervise the return of people displaced from their homes,” he added.
Tikrit, about 140km (90 miles) north of the capital Baghdad, was captured by IS militants last June, as they swept southwards from Mosul through predominantly Sunni areas and routed the army.
The offensive to recapture Tikrit was launched on 2 March and involved some 30,000 personnel, two thirds of them from the Popular Mobilisation (Hashid Shaabi), a force comprising dozens of Iranian-backed Shia militia.
Iranian military advisers, led by Gen Qasem Soleimani of the Revolutionary Guards’ Quds Force, initially co-ordinated the operation.
Although there was no air support from the US-led coalition, the government’s forces made rapid progress over the first two weeks, driving IS militants out of towns and villages along the Tigris river near Tikrit and then encircling the city. But the offensive then stalled.
IS militants were able to repel assaults on the city centre until Mr Abadi requested coalition air strikes last week, prompting a boycott by most of the militia in the Popular Mobilisation.
Separately on Wednesday, the UN mission to Iraq announced that at least 997 people, including 729 civilians, had been killed in violent attacks in March, slightly down from February’s toll.
The new UN envoy, Jan Kubis, said the recapture of Tikrit represented a “victory for all the Iraqi people”, and that the UN was ready to provide assistance to the Iraqi authorities.