KABUL -- Afghanistan's Islamic State affiliate and a rival militia controlled by a prominent lawmaker have killed eight captured fighters from both sides in a brutal killing spree in the eastern border province of Nangarhar, an Afghan official said on Sunday.

According to Ghalib Mujahid, the governor of the Achin district in Nangarhar, each group beheaded at least four fighters from the rival group who were captured during battles on Saturday.

The militia is loyal to Zahir Qadir, Afghanistan's deputy speaker of parliament. Mujahid said Qadir's militiamen killed the captive IS gunmen and put their heads on display along a main road through the district.

The killings reflect rampant lawlessness in this remote part of Afghanistan. It is not unusual for powerful Afghan figures and politicians to control personal militias, though the central government and international organizations such as the United Nations have expressed concern about a proliferation of armed groups that are not part of the government's security force.

Achin is one of four districts that Afghan officials say has come under IS control in recent months. Government forces have returned to the region to try to dislodge the IS extremists, who also fought fierce battles with the rival Taliban during the summer months.

IS has also established a presence in other volatile regions of Afghanistan, but Nangarhar appears to be their main powerbase.

Mujahid condemned the brutal killing of the captives on both sides. "It is not acceptable for either side to act like this."

Meanwhile, in southern Helmand province -- where the Taliban are fighting government forces for control of a number of districts -- a roadside bomb killed a local police commander and two of his bodyguards on Sunday, said provincial police spokesman Shah Mahmood Ashna.

He said that other two police officers were wounded in the explosion in the provincial capital of Lashkar Gah.