BAGHDAD — Iraqi Prime Minister Haider al-Abadi has ordered an "immediate" investigation into the killing of a senior military officer by "undisciplined individuals" at a checkpoint north of Baghdad.

Brig. Gen. Shareef Ismaeel al-Murshidi, a brigade commander whose forces are tasked with protecting al-Abadi and Baghdad's Green Zone, was shot dead Tuesday at a checkpoint outside Samarra. State-sanctioned Shiite militias play a large role in securing the town, which is home to a major Shiite shrine.

The statement issued by al-Abadi's office late Tuesday did not provide further details about the incident.

Two police officers in Samarra said the three-vehicle convoy ignored orders to stop at two checkpoints. When it reached a third checkpoint an exchange of fire erupted between the convoy on one side and militiamen and Federal Police on the other. The militiamen belonged to the so-called Peace Brigades, led by Shiite cleric Moqtada al-Sadr.

Two of al-Murshidi's guards were also killed, while four others were wounded, they said. A medical official confirmed the casualty figures. All officials spoke on condition of anonymity because they were not authorized to release information.

On Wednesday, Iraqi state TV aired the official funeral in the Green Zone, which al-Abadi attended along with the slain officer's relatives. Al-Sadr has sent a delegation to Samarra to investigate the incident.

When Islamic State militants swept across northern and western Iraq in mid-2014, tens of thousands of Shiite men answered a call-to-arms by the country's top Shiite cleric, Grand Ayatollah Ali al-Sistani, to defend the nation. They played a key role in a number of battles against IS, which has since been driven from nearly all the territory it once ruled.

Today the militias number in the tens of thousands and are deployed across the country to maintain security, alongside the army and police.