Iraqi soldiers backed by US-led coalition aircraft repelled an attack Friday by the Islamic State group on a base where hundreds of US troops are training local security forces, officials said.
"The Iraqi Security Forces (ISF) supported by Coalition surveillance assets defeated the attack (on Al-Asad air base in western Iraq), killing all eight attackers," a US military statement said.
An Iraqi army colonel and a defence ministry official said the botched assault involved at least seven would-be suicide bombers using a military vehicle.
It came hours after IS fighters launched an offensive on the nearby town of Al-Baghdadi, one of the few in the Sunni province of Anbar still under government control.
Eighteen soldiers, including a brigadier general, were killed in the clashes in Baghdadi and the attack on Al-Asad, army and police officials said.
"IS gunmen launched an attack yesterday (Thursday) afternoon, targeting the police headquarters of Al-Baghdadi and two government buildings in the town centre," a police lieutenant colonel said.
He said the attackers were assisted by "sleeper cells" already inside the town, one of a handful in the Sunni province of Anbar not under IS control.
An army colonel said police, army and anti-jihadist tribal forces on Friday repelled the jihadists from most neighbourhoods of the town on the Euphrates river, northwest of Baghdad.
But IS, in its daily online radio broadcast, said that "soldiers of the caliphate, with God's help," had captured the police headquarters and an army barracks in Al-Baghdadi.
Coalition planes had been unable to carry out strikes during the clashes there because of "heavy fog", it said.
The Pentagon said a total of five air strikes had been carried out near Al-Asad since Thursday morning.
A suicide car bomb, four IS "tactical units", a checkpoint and an earth mover were destroyed in the strikes, it said without elaborating.
About 300 members of the US security forces are at the base in the heart of Anbar province training Iraqi troops.