Iraqi forces have completed the recapture of Dhuluiyah, parts of which had been held by the Islamic State of Iraq and the Levant (ISIL) for months, commanders have said.
Pro-government forces had pushed into the town, located 90km outside Baghdad, from the north two days earlier, fighting their way south.
"Forces from the army and the police and [militiamen] and tribal fighters succeeded today in regaining control of Dhuluiyah," an army major general told the AFP news agency on Tuesday.
The officer said that 50 military vehicles advanced from the north and linked up with allied forces in the town's southern Jubur area, which had resisted repeated assault by ISIL.
This "means the complete liberation of Dhuluiyah and the end of the [ISIL] presence," he added.
A leader in the Shia Badr militia, which took part in the operation, confirmed the "complete liberation of Dhuluiyah".
"We succeeded in breaking the blockade which was imposed by [ISIL] on the Jubur tribe," the commander said.
People fired in the air and honked car horns in celebration, according to a policeman in the town, which is strategically located on roads linking the eastern province of Diyala to Salaheddin province in the north.
Omar al-Juburi, a leader of the tribal forces battling ISIL, said earlier that military reinforcements had arrived to carry out a renewed push to retake the town.
Clashes took place in some areas on Tuesday where IS forces were holed up in houses, Juburi said.
ISIL fighters have been carrying out "suicide attacks" on pro-government forces, he added.
On Monday, ISIL published pictures online showing what it described as battles in Dhuluiyah.
In one of the pictures, fighters are seen rigging a car with explosives, while another shows a man carrying out a suicide attack on government forces.
The Iraqi defence ministry said on Monday that government warplanes had carried out raids against ISIL positions in the town.
Coalition air strikes
In October, Iraqi forces retook most of Dhuluiyah from ISIL, but the armed group later launched a counter-offensive and were able to recapture ground.
Since Sunday government forces backed by Sunni tribesmen and Shia militiamen have been clearing bombs and other explosives placed by the ISIL in various parts of the town.
ISIL spearheaded an offensive in June that overran Iraq's second city Mosul and then swept through much of the country's Sunni Arab heartland.
Backed by US-led air strikes, Kurdish forces, Shia militias and Sunni tribesmen, Iraqi troops have since managed to wrest back some territory, but three major cities and swathes of other territory are still outside government control.
The US-led coalition announced that it had carried out eight air strikes against ISIL in Iraq on Tuesday, targeting fighters as well as vehicles and buildings used by the fighters.
It also launched seven raids in Syria, where ISIL has also seized large areas for its self-proclaimed cross-border Islamic "caliphate".