Iraqi forces on Thursday pushed the Islamic State group from Qayyarah, a northern town considered strategic for any future offensive against the jihadists' last stronghold of Mosul.
Prime Minister Haider al-Abadi hailed the victory as a key step in the fight against IS but hours later suffered yet another political setback when lawmakers impeached his defense minister.
Special forces, backed by US-led coalition air strikes, wrapped up a three-day operation to retake Qayyarah, a town located on the banks of the Tigris river.
"We control all parts of the town and managed, in very limited time, to root out Daesh," Lieutenant General Riyadh Jalal Tawfik, who commands Iraq's ground forces, told an AFP reporter in Qayyarah, using an acronym for IS.
The commander said engineering units were now clearing the town, which lies about 60 35 miles south of Mosul, of unexploded ordnance and booby traps.
Residents greeted the security forces under skies blackened by huge fires IS fighters set to nearby oil wells in recent days.
The bodies of suspected IS fighters were strewn across some of the town's streets, especially around its southern entrance, which saw the worst fighting and significant destruction.
Abadi issued a statement hailing what he said was a key step towards reclaiming Mosul, IS's de facto Iraq capital and the country's second city.
"Our heroic forces achieved a big victory, an important step towards the liberation of Mosul," Abadi said.
The prime minister's mood was unlikely to have remained upbeat very long however, with one of his key allies losing a no confidence vote by parliament moments later.
The house impeached Defence Minister Khaled al-Obeidi by 142 votes to 102 -- and 18 abstentions -- over corruption allegations.
Obeidi's downfall is the latest development in a bitter feud that erupted this month with rival Sunni politician Salim al-Juburi, who is the parliament speaker.
Qayyarah residents cooperated
At a hearing in parliament, Obeidi answered graft accusations against him by saying they were trumped up because he had refused to be part of corrupt deals.
He fought back with his own allegations against Juburi and other lawmakers but the speaker escaped unscathed after an integrity committee dropped the case.
"I tried to fight corruption in every way but it appears that its lords are stronger and their voices louder," Obeidi said in a statement after the vote.
Unity in Iraq's Sunni camp is seen as key to preparing an offensive against Mosul.
The operation against Qayyarah was launched on Tuesday and led by Iraq's elite counter-terrorism service (CTS).
Iraqi forces had already recaptured a nearby air field and Qayyarah is expected to become one of the main launchpads for an assault on Mosul in the coming weeks or months.
Officers have said the push into Qayyarah was coordinated with small groups of armed residents opposed to IS inside the town.
"The people were very cooperative, that is why none of them fled, they did not attack our forces and our forces did not hurt them," General Tawfik said.
A CTS spokesman confirmed pro-government sleeper cells were involved in the operation but would not provide further details.
IS has suffered a string of military setbacks over the past year and lost more than half of the territory it controlled two years ago, in a trend that looks irreversible.
Jassem Hanoun, an Iraqi political and security analyst, argued the timing of Obeidi's removal could not be worse.
"It will have a direct impact on the battle since the ministry will be run by the deputy, who has limited authority," he said.
The jihadists are vastly outnumbered and outgunned in the Mosul area but, besides the obstacles raised by a divided political class, Iraq also faces an unprecedented humanitarian crisis.
Around 3.4 million people have already been forced to flee their homes by conflict since the start of 2014.
The United Nations' refugee agency warned this week that an offensive on Mosul could displace another 1.2 million people and cause a major disaster.