LONDON (Reuters) - Ayatollah Mahmoud Hashemi Shahroudi, a senior Iranian cleric and a former chief justice, died in Tehran on Monday after a long illness, state media reported.

Shahroudi, 70, was a close ally of Iranian Supreme Leader Ayatollah Ali Khamenei and had been seen by analysts as a possible successor to him.

He cut short a visit to Germany for treatment in January when activists referred him to German prosecutors, citing his record of passing death sentences which they said amounted to a crime against humanity.

Shahroudi was head of Iran’s hardline judiciary for a decade until 2009, but he implemented some reforms including banning death penalty by stoning, arguing it was tarnishing Iran’s image.

However, human rights groups say he failed to put an end to arbitrary arrests of political and human rights activists, and mistreatment and torture of the prisoners. Dozens of newspapers were banned under his watch and many journalists and bloggers faced long term sentences.

Shahroudi was appointed by Khamenei in 2017 as the head of the Expediency Council, a body intended to resolve disputes between parliament and a watchdog body, the Guardian Council.

He was born in the city of Najaf in Iraq to Iranian parents. In the 1970s he was jailed and tortured by Saddam Hussein’s security forces because of his political activities.

He moved to Iran after the Islamic revolution in 1979 and was promoted to top posts. In recent years, Shahroudi aimed to raise his profile in Iraq as a replacement for Ayatollah Ali Sistani, the top Shi’ite cleric and a powerful figure in Iraq.