Ayatollah Mohammad Reza Mahdavi Kani, chairman of the Assembly of Experts, died in hospital on Tuesday at the age of 83.
The senior cleric was hospitalized in June 4 due to heart problems and since then had been in a coma.
In a letter of condolence, Leader of the Islamic Revolution Ayatollah Seyyed Ali Khamenei praised the services of the late cleric to the Islamic Revolution and described him as "a loyal and revolutionary politician" and "a pious religious scholar."
President Hassan Rouhani also declared two days of national mourning.
Ayatollah Kani had succeeded former president Akbar Hashemi Rafsanjani as chairman of the influential Assembly of Experts since March 2011. The high-ranking body elects and oversees the activities of the leader of the Islamic Revolution.
Ayatollah Kani was a close ally of the late Imam Khomeini, the founder of the Islamic Republic, and played a key role in the events that culminated in the Islamic Revolution of 1979.
He took up several important posts after the revolution. The senior cleric was also the founder and chairman of the renowned Imam Sadeq University, where many high-ranking politicians and experts in various branches of government studied.
The funeral procession for the deceased ayatollah is to take place on Thursday at the campus of the University of Tehran.