The Islamic State group launched attacks on Iraqi bases in two western towns that left at least 17 members of the security forces and 40 jihadists dead, security and medical sources said Thursday.
Seven policemen and four soldiers were killed in an attack on police headquarters in the Anbar provincial town of Heet, while at least six members of federal forces were killed in an assault on a major army base in Ramadi.
In Heet, on the Euphrates River about 150 kilometres (95 miles) west of Baghdad, 25 gunmen attacked the police headquarters shortly after midnight.
"They smashed the gates open with suicide car bombs, then 25 men tried to break into the HQ, sparking heavy clashes," Colonel Jabbar al-Nimrawi told AFP.
"The police killed 20 of them and the remaining five withdrew to the electricity building. They are still under siege; they have sniper rifles.
Nimrawi said the building was surrounded by police, army, elite counter-terrorism troops and anti-jihadist Sunni tribal forces.
Heet hospital's Doctor Nael Ahmed said seven police officers and four soldiers had been killed.
Just outside Ramadi, less than 100 kilometres (60 miles) west of Baghdad and further down the Euphrates, a similar suicide unit attacked the 8th Brigade headquarters Wednesday.
"They attacked from three directions. They used suicide armoured vehicles to break into the compound, then 13 fighters with suicide vests entered," said senior army officer Awad al-Dulaimi.
Signup to our newsletter and follow us on Facebook and Twitter!
"We killed the last one at 5:00 am (0200 GMT) after fierce exchanges. We also killed seven who had come from another direction," he said.
A doctor at Ramadi hospital, Ahmed al-Ani, confirmed that he had received the bodies of three members of the counter-terrorism force, including a colonel, and three soldiers.
Some of the last pockets still under government control in the Sunni province of Anbar are in Heet and Ramadi.
The government also retains control of Haditha dam, further up the Euphrates towards Syria. US warplanes have struck IS forces around the dam several times.
Some parts of the restive province, such as the city of Fallujah, were already out of government control before IS launched its major offensive in Iraq four months ago.
In recent days, the army has suffered a string of setbacks in Anbar, including when jihadists attacked bases near Fallujah.
The army has confirmed that 155 of its soldiers are dead or missing as a result. IS claimed it killed 300 of them and looted large quantities of military vehicles and equipment.
The jihadist group has since advanced west towards Ramadi and left government forces with few supply options in the province.
According to Iraqi officers, 240 soldiers are trapped inside a base in Albu Aitha, just east of Baghdad, with little to eat or drink.