TEHRAN, Iran — A high-ranking Iranian officer advising troops battling extremist ISIS forces was killed in the Iraqi city of Samara, according to the official Iranian media. It was not immediately clear how Brig. Gen. Hamid Taqavi was killed. His funeral was held in a compound for Iran’s Revolutionary Guards in the capital Tehran on Monday, Sepah News reported, adding that he will be buried in his hometown of Ahvaz in southwestern Iran on Tuesday. Sepah News is the official online news site for the Revolutionary Guards, a hard-line military branch of Iran’s military.

Shiite Iran is allied to Syria’s President Bashar Assad and the government of Iraq, who are battling extremist Sunni militants sweeping through much of Iraq and Syria. While Iran is not a member of the coalition that Secretary of State John Kerry cobbled together to fight ISIS — and Washington and Tehran have ruled out working together to defeat the militants — an unknown number of Iranian advisers and fighters are reportedly helping defend Shiite religious sites against ISIS.

Ali Shamkhani, the secretary of Iran's Supreme National Security Council, told mourners at the funeral that Taqavi’s participation was crucial for the future of Iran. “If Tagavi and his colleagues do not give blood in Samara, we will have to give our blood in Sistan, Azarbaijan, Shiraz and Esfahan,” he said, according to state news services IRNA and ISNA, in reference to Sunni extremists possibly attacking largely Shiite Muslim Iran.

IN-DEPTH

- Ali Arouzi in Tehran and F. Brinley Bruton in London