Hamid Taqavi
Hamid Taqavi (pictured wearing glasses) had been advising the Iraqi army and the Syrian Arab Army when he was killed in SamarraTwitter

A senior commander in Iran's Revolutionary Guard has been shot dead whilst fighting in Iraq.

Brigadier General Hamid Taqavi, was killed by an Islamic State sniper, who was reportedly hidden behind a power transformer in the Iraqi city of Samarra in Salahuddin province.

Taqavi is believed to be the highest ranked officer to die outside of Iran since the Iran-Iraq war.

The Revolutionary Guard said: "Taqavi played a valuable and unforgettable role in countering the enemies of Islam."

A veteran of the 1980-1988 war with Iraq, in which his father and brother were killed, Taqavi had been working as a senior advisor, assisting both the Syrian Arab Army and Iraqi Army in their fight against Islamic State and other extremists groups.

Iran has confirmed the death of Taqavi after news of it emerged on Islamic State social media accounts.

An official Defence Ministry statement was released by Iran: "Taqavi became a martyr while fulfilling his duty as a military adviser in the fight against Daesh (IS) revisionist terrorists, a glorious end to a long valuable service to advance the cause of (Iran's 1979) Islamic revolution."

Senior Iranian officers and combatants have been working closely in Iraq and Syria, in an attempt to defend holy Shi'ite sites from the advances of the extremist group Islamic State.

Led by Major General Qasem Soleimani, commander of the Revolutionary Guard's elite and secretive Quds Force, Iran has played a key role in helping to slow down Islamic State's advances on Baghdad, following a request for help by the Iraqi government and top Shi'ite clerics.

Samarra is home to the al-Askari shrine, one of the most important Shi'a shrines in the world. Built in 944, the splendid gold dome of the Shrine was destroyed in a bomb attack in February 2006. A second bomb attack in 2007 destroyed the two main minarets but both the dome and the minarets have since been restored in 2009.

Islamic State have previously destroyed a number of Shi'a, Christian and minor group shrines, in accordance with their radical interpretation of Shari'a law.