A suicide bomber blew himself up in a town in western Iraq on Friday, killing at least eight civilians and a soldier, officers said.

He was one of a group of four suicide bombers who infiltrated a neighbourhood of Al-Baghdadi, a town on the Euphrates River in the restive western province of Anbar.

"Army forces were able to kill three suicide bombers after trapping them in a house in the Martyrs neighbourhood by detonating their belts with gunfire", a senior police officer said.

"The fourth managed to hide and later blow himself up in the midst of a group of civilians and soldiers", the officer said.

The police officer and Sharhabil al-Obeidi, a local district official, said eight civilians and a soldier were killed in the blast, while another 11 people were wounded.

Anbar is a sprawling desert province traversed by the Euphrates River and bordering Syria, Jordan and Saudi Arabia.

It has long been an insurgent stronghold, and Islamic State already controlled parts of it before it swept through Iraq in 2014 to take over around a third of the country.

Pro-government forces have since retaken most towns and cities in Anbar, but the jihadists still control areas near the Syrian border and have desert hideouts from which they harass federal forces.