By Jon Leyne
BBC Tehran correspondent
Grand Ayatollah Montazeri was marginalised after the 1979 revolution
For many years Grand Ayatollah Hoseyn Ali Montazeri was one of the most vocal, and respected, critics from within Iran.
His observations were all the more damaging, because they came from a respected Shia Muslim theologian. As a grand ayatollah he was of a higher clerical rank than the Supreme Leader, Ayatollah Ali Khamenei.
The authorities did not know how to react then, and they will have an even harder time reacting now to the many opposition supporters coming out onto the streets to mourn his passing.
Until 1989, Grand Ayatollah Montazeri was seen as the likely successor to Ayatollah Khomeini, the founder of the Islamic Republic. But shortly before Ayatollah Khomeini's death, Hoseyn Ali Montazeri fell out with him over the execution of thousands of opponents of the government at the end of the Iran-Iraq war.
Since then he had lived in the clerical city of Qom, sometimes under house arrest, always under pressure from the authorities.
'Rule of jurist'
Following President Mahmoud Ahmadinejad's disputed re-election in June, his criticism became even more outspoken. The election was a fraud, he warned, and Iran's leaders were in danger of losing their legitimacy.
It was a message received enthusiastically by many opposition supporters. Yet it was also a strange alliance.
Born into provincial family in 1922 and educated at a seminary
Arrested and tortured for leading protests against Iran monarchy
Designated successor to Islamic Republic's founder, Ayatollah Khomeini
Fell out with Ayatollah Khomeini in 1989 over Iran's human rights record
House arrest in 1997 for criticising current supreme leader
Issues a fatwa against President Ahmadinejad after 2009 election
Grand Ayatollah Montazeri represented a growing strand of theological criticism from among Iran's senior clerics.
Many of them are uneasy about the authority vested in the Supreme Leader, Ayatollah Khamenei, under the principle of "Velayat-e-Faqih" - which translates roughly as the rule of the jurist, or the rule of the just.
The unease of those senior clerics has been compounded by the growing power of the Revolutionary Guards, who have increasingly supplanted the clergy as the real power in Iran.
So, Grand Ayatollah Montazeri's views were another example of the deep split at the very heart of the ruling establishment.
Many opposition supporters, though, come from Iran's increasingly secularised younger generation.
While they have enormous respect for Grand Ayatollah Montazeri, their focus is on building a more aspirational, more liberal society - as their critics might charge, a more Westernised Iran.
Opposition supporters are already showing their support for the grand ayatollah's principles by going out on the streets to mark his death.
Crowds have been gathering ahead of Montazeri's funeral
On Monday 21 December some opposition supporters clashed with police after the funeral of a dissident cleric, opposition websites said.
Tens of thousands took part in a procession after Grand Ayatollah Montazeri's funeral in Qom.
They may also look to mark the seven-day anniversary of his death next weekend. There had already been talk of major demonstrations then to coincide with the Shia Muslim festival of Ashura.
It poses a huge dilemma for the government.
Can it really be seen trying to prevent mourners marking the death of a grand ayatollah?
Already the security forces are on alert, and may even try to prevent mourners coming out onto the streets, or travelling to Qom for the funeral.
It poses a new and major challenge for Iran, and those who rule it.