BAGHDAD -- A suicide blast targeting Iraqi security forces and subsequent clashes with Islamic State extremists on Tuesday killed at least 23 troops and pro-government Sunni fighters in the country's embattled western province of Anbar, officials said.

The day's heavy toll for the Iraqi forces came as they struggle in battles against the Islamic State group and try to claw back territory lost to the extremists during the militants' blitz last year. Iraq's prime minister vowed on Tuesday to dislodge IS militants from all areas under their control.

Police officials said a suicide bomber first struck a gathering of pro-government Sunni fighters near the town of al-Baghdadi, about 180 kilometres northwest of Baghdad, in the morning hours.

Soon after, IS militants attacked nearby army and police positions, setting off hours-long clashes. Police and hospital officials said 23 were killed and 28 were wounded in all on the government side. They did not give the death toll on the militants' side, saying only that the attackers "sustained some casualties" and declining to provide further details. All officials spoke on condition of anonymity because they were not authorized to speak to the media.

In Baghdad, Prime Minister, Haider al-Abadi pledged that Iraq's forces would retake all areas that fell to IS during last summer's stunning blitz.

"We will emerge as victorious and the day our lands are liberated is nearing," al-Abadi told a group of newly-graduated army officers, speaking at the Military Academy as Iraq marked Army Day. "Our goal ... is that peace and prosperity prevail in Iraq and end this dark period in Iraqi history."

A parade was also staged to mark the day, complete with jet fighters, helicopters and transport planes flying overhead.

Meanwhile, the Islamic State group announced killing eight men in Salahuddin province north of Baghdad for allegedly co-operating with government forces and airstrikes by the U.S.-led coalition targeting the militant group.

The group posted photographs showing eight blindfolded and bearded men in orange jumpsuits, their hands tied behind their backs. Five were identified as police officers and two as informants, but no information was provided on the eighth victim. The photos show the men by a riverbank next to masked gunmen, under what looks like a bridge. They are on their knees as the gunmen appear to be readying to shoot them. Other photos show bloodied bodies of seven of the men, lying on the ground.

The Islamic State group provided no details on the purported killings. The authenticity of the photos could not be independently verified but they were posted late Monday on a Twitter account frequently used by the militant group.

However, a provincial official, who spoke on condition of anonymity fearing for his safety, offered a different account on the photos, saying Tuesday that the men depicted in the images were army officers who had abandoned the military before the militants' takeover of their area last year. The official said the men did not co-operate with Iraqi government forces.

The Salahuddin provincial capital, Tikrit, and other nearby towns have been in militant hands since June, when the Islamic State group expanded with lightning speed across Sunni-dominated regions of northern and western Iraq as government forces collapsed.

Since then, the IS group has declared a self-styled caliphate over about a third of Iraq and neighbouring Syria. But there has been growing resentment among some residents fueled by the militant group's enforcement of its extremist interpretation of Islamic law, economic stagnation and a lack of public services.

Seeking to squash any potential uprising, the militants have started killing policemen and soldiers living in areas of Iraq under their control -- especially after the U.S.-led coalition air campaign began supporting ground offensives by Iraqi government forces, Kurdish fighters and Shiite militias.