Tehran University's prayer hall has been the stage for high drama since the early days of the Islamic revolution, and Hashemi Rafsanjani'sappearance today was another of many electrifying moments in Iran's recent history.

Surrounded by heavy security under the cantilevered roof, the former president spoke out in public for the first time since last month's disputed election, warning that the country was "in crisis."

That may be a statement of the blindingly obvious – but it carries force precisely because of Rafsanjani's special place in Iranian politics: he is both hugely influential and deeply unpopular, a bitter rival of the supreme leader Ayatollah Ali Khamenei and – crucially – one of the surviving giants of the revolutionary era.

Whatever he said, his very presence at such a tense time would have guaranteed rapt attention – one reason why his sermon was not, as is usual, broadcast live on state TV whose cameras are mounted permanently in the university mosque.

The sense of excitement was heightened because of the presence of Mir Hossein Mousavi, who claims to have beaten Mahmoud Ahmadinejad on 12 June and who rejects the election result as "illegitimate." His fellow candidate, the reformist cleric Mehdi Karoubi, was also there.

Rafsanjani's calls to restore trust by releasing prisoners, freeing the media, using only legal means, and by dialogue between opposition and the regime, were couched in the language of legitimacy and justice. "Don't let our enemies laugh at us by putting people in prison," the cleric urged. "We must search for unity to find a way out of our quandary."

Specific proposals had been laid before the expediency council (an advisory body to the supreme leader) he said, a reminder that he has a real role to play.

"His demands were in line with what the reformists want but he did not explicitly challenge the legitimacy of the Ahmadinejad government," concluded one veteran Iranian political analyst. "This was an effort to play the role of power-broker – the role that Khamenei should have played but did not."

Rafsanjani also stressed the importance of the "republic" in the Islamic Republic of Iran, a deliberate riposte to those hardliners who stand accused of planning an Islamic dictatorship. His references to Ayatollah Khomeni praised the late leader's positive attitude towards ordinary people – a clear invitation to make an unflattering comparison with Khamenei.

The sermon was not an overt challenge to the regime, but it did graphically underline the divisions he was warning about: as he was speaking the crowd burst into competing slogans of "death to the dictator" and "death to opponents". No one could have had any doubt who was who. Predictably, trouble erupted in the streets immediately afterwards.

Normally, Friday prayers at Tehran University are a showcase for the regime, which makes sure that thousands of its loyal supporters are bussed in to fill the hall and shout familiar slogans: death to America, death to Israel, and other favourites. That makes it a regular port of call for foreign journalists, invited to witness the peculiarly Iranian combination of religion and politics, prayer and agitprop. Foreign media coverage has been drastically reduced as part of the post-election crackdown. But profound divisions, not defiant unity, are now on open display.