Iraqi troops have recaptured the strategically important western town of Hit from Islamic State militants after weeks of fighting, officials say.
The military declared that Hit had been "completely liberated" by units of the elite Counter-Terrorism Service (CTS).
Since it began in mid-March, the assault on the town has been the focus of the government's wider campaign to regain control of Anbar province.
Hit sits on a key supply route linking IS-held territory in Iraq and Syria.
Iraqi military officials and the US-led coalition against IS believe that by clearing the town 150km (93 miles) west of Baghdad, they can build on other recent gains in the vast desert of Anbar.
'We will never leave'
CTS spokesman Sabah al-Numani told the AFP news agency that troops took complete control of Hit on Thursday, after clearing it of the last remaining gunmen.
IS militants in the town, between Ramadi and Haditha, put up heavy resistance to the assault. Air strikes by coalition warplanes were being called in by troops late into Wednesday night, CTS commander Gen Abdul Ghani al-Asadi told the Associated Press.
Gen Asadi said that in intercepted radio communications IS fighters were heard saying that "this is our headquarters and we will never leave this area".
More than 20,000 civilians fled Hit after the launch of the operation to retake the town last month, but thousands more were believed to be trapped inside during the last stages of the battle.
The offensive on Hit was reportedly delayed by a two-week sit-in protest in Baghdad by supporters of the powerful Shia cleric Moqtada al-Sadr, as forces had to be pulled from Anbar to protect them.
The protesters demanded that Prime Minister Haider al-Abadi move ahead with a plan to replace ministers appointed on the basis of political affiliation with technocrats in a bid to tackle systemic political patronage that has aided corruption.
At the end of March, Mr Abadi submitted a list of non-partisan nominees, but it was rejected by the main parties, who put forward their own candidates,
Mr Abadi submitted a second list with their approval on Tuesday, triggering a sit-in in parliament by dozens of MPs, who demanded an opportunity to vote on the original list.
There were chaotic scenes on Wednesday as a brawl broke out during a debate over the reshuffle, and the speaker Salim al-Jabouri formally called for parliament to be dissolved.
On Thursday, a number of MPs held a vote of no-confidence in Mr Jabouri, a leading Sunni Arab politician and ally of the prime minister. But Mr Jabouri said the session lacked the necessary quorum and was marred by "many legal and constitutional errors".