The jihadist attackers entered Amriyat al-Fallujah, a government-held town 50 kilometres southwest of Baghdad and a key base for any operation against the IS-controlled city of Fallujah, further north.
"Eight suicide bombers snuck into the city, the security forces succeeded to repel the attack by killing five of them," Major General Ismail al-Mahalawi, who heads Anbar Operations Command, told AFP.
"The other three blew themselves up, which led to the killing of three civilians and two policemen," he said.
The government's "war media cell" that provides updates on Iraq's fight against the jihadists posted a video of fighters shooting in the air to celebrate their thwarting of the attack.
More From This Section
A vehicle could be seen dragging the body of an attacker on the road as pro-government fighters cheered.
Amriyat al-Fallujah lies around 20 kilometres south of Fallujah, which is one of the two main remaining cities IS controls in the country.
The other is Mosul, the country's second city, which lies in the north of Iraq and has a much larger population.
Fallujah has found itself almost completely surrounded, raising concern over the fate of civilians trapped there with dwindling food supplies.
The US-led coalition that backs Iraqi forces with air strikes, training and special forces on the ground, has set Mosul as its priority, hoping to deal a fatal blow to IS' self-proclaimed "caliphate".
Some key players in the mosaic of Iraqi forces involved in the war against IS however favour launching an offensive against Fallujah first.