Samarra, Iraq: A general charged with ensuring security ahead of a visit by Iraq’s prime minister was killed Tuesday in a shootout with militia fighters, officials said.

Special forces commander Sherif Esmail was heading back to Baghdad after preparing the ground for a trip planned for Wednesday by premier Haider Al Abadi to the conflict-ravaged Nineveh province.

“Clashes broke out with fighters from Saraya Al Salam,” a group loyal to prominent cleric Moqtada Sadr, a security source said, after a verbal altercation spiralled out of control.

“The general was killed and three of his men were wounded,” the source told AFP on condition of anonymity.

The prime minister’s office confirmed the death of Esmail and blamed “shots from undisciplined fighters”, without naming a group.

Abadi had “ordered the immediate opening of an investigation”, a statement said.

The violence comes two months ahead of legislative elections in Iraq that Al Abadi is hoping will see him remain in charge after claiming victory against Daesh at the end of last year.

Commentators have previously mooted a potential alliance between Al Abadi and Sadr’s parties at the vote.