Tens of thousands of opposition supporters packed Iran's main Islamic prayer sermon Friday, chanting "freedom, freedom" and other slogans as their top clerical supporter Akbar Hashemi Rafsanjani delivered a sermon sharply criticizing the country's leadership over the crackdown on election protests.

Outside Tehran University, where the prayers were held, pro-government Basiji militiamen in front of a line of riot police fired tear gas at hundreds of opposition protesters who chanted "death to the dictator" and called on President Mahmoud Ahmadinejad to resign. Some protesters kicked away the tear gas cannisters as others scattered and regrouped.

The opposition aimed to turn the Friday prayers into a show of their continued strength despite heavy government suppression since the disputed June 12 presidential election. Opposition leader Mir Hossein Mousavi, who claims to have won the election, sat in the front row of worshippers, attending for the first time since the turmoil began. Many of the tens of thousands at the prayers wore headbands or wristbands in his campaign color green, or had green prayer rugs.

Click here for photos.

In his sermon broadcast live on radio nationwide, Rafsanjani reprimanded the clerical leadership for not listening to the controversy over the election, which was declared a victory for Ahmadinejad despite opposition claims of fraud.

"Doubt has been created (about the election results)," Rafsanjani said. "There is a large portion of the wise people who say they have doubts. We need to take action to remove this doubt."

Rafsanjani couched his sermon in calls for unity in support of Iran's Islamic Republic. But his sermon was an unmistakable challenge to Supreme Leader Ayatollah Ali Khamenei, who declared Ahmadinejad's victory valid and demanded an end to questioning of the results. Rafsanjani said the dispute has split clerics and warned of "crisis."

The sermon was Rafsanjani's first since the election, ending his unusual silence over the turmoil. Worshippers interrupted him with chants of "azadi, azadi" — Persian for "freedom" — and Rafsanjani got tears in his eyes as he spoke of how Islam's Prophet Muhammad "respected the rights" of his people. He criticized the postelection wave of arrests, saying the leadership should show sympathy for protesters and urging the release of those detained.

Rafsanjani, a former president, is considered the opposition's top supporter within Iran's clerical leadership. He is a bitter rival of President Mahmoud Ahmadinejad and is believed to support Mousavi behind the scenes — his daughter and four other relatives who openly backed Mousavi were briefly detained during protests last month.

In his sermon, Rafsanjani said the Islamic Republic must listen to the people's voices. "We believe in the Islamic Republic ... they have to stand together," he said. "If 'Islamic' doesn't exist, we will go astray. And if 'republic' is not there, (our goals) won't be achieved. Where people are not present or their vote is not considered, that government is not Islamic."

After the election, hundreds of thousands marched in the streets in support of Mousavi. But after Khamenei validated the results, police, elite Republican Guards and Basiji militiamen launched a fierce crackdown on protesters in which hundreds were arrested and at least 20 killed — though human rights groups say the figure could be several times that official toll.

The scene outside the university on Friday was tumultuous, as hundreds of Mousavi backers converged on the gates. Before the sermon, police fired tear gas at some trying to enter the prayer. When Mahdi Karroubi, another pro-reform candidate in the June election, headed for the prayers, plainclothes hard-line supporters attacked him, shoving him and knocking his turban to the ground, witnesses said. "Death to the opponent of Velayat-e-Faqih," the hard-liners chanted as they attacked him, referring to the supreme leader, the witnesses said.

As she headed for the university, a prominent women's rights activist, Shadi Sadr, was beaten by militiamen, pushed into a car and driven away to an unknown location, taken away, Mousavi's Web site www.mowjcamp.com and a women's rights site www.meydaan.com said.

Inside the prayers — held on a former soccer field covered with a roof — some of the worshippers rubbed their eyes as tear gas from the scuffles outside drifted in during Rafsanjani's speech.

After the sermon, hundreds of the worshippers joined those still outside university, chanting Mousavi's name and "coup-d'etat government, resign, resign," referring to Ahmadinejad.

Some in the sermon and afterward chanted "death to Russia" and "death to China," referring to Ahmadinejad's alliance with both countries. Ahmadinejad has come under criticism in Iran for not criticizing Beijing over Muslim deaths in China's western Xinjiang province.

Members of the hard-line Basij militia charged the crowd, firing tear gas to disperse the crowd, witnesses said. The witnesses spoke on condition of anonymity because of fears of government retaliation.

In his sermon, Rafsanjani sharply criticized the Guardians Council, one of the three most powerful clerical bodies that oversee the elected government. The Guardians Council is the center for Khamenei and Ahmadinejad's strongest backers, and after the election it conducted a partial recount that validated Ahmadinejad's victory.

Rafsanjani said the Guardians Council had had an "opportunity to unite the people and regain their trust," but the chance was "not used properly."

Rafsanjani also openly spoke of the split among clerics over the election. Many other prominent clerics have been sharply critical of the government or have failed to announce their backing for Ahmadinejad, including most of the country's "maraje'-e-taghlid," or "sources of emulation," Shiite clerics of the highest rank whose religious rulings are closely obeyed by their many followers.

"The maraje'-e-taghlid have always supported and served (the people). Why some of them are offended?" Rafsanjani said. "We need to keep them beside us. We need to support them and rely on them."

Rafsanjani criticized the crackdown on postelection protests, calling for the release of those arrested.

"Sympathy must be offered to those who suffered from the events that occurred and reconcile them with the ruling system. This is achievable. We need to placate them," he told the worshippers in the Tehran University prayer hall.

"It's not necessary ... to keep individuals in jail. Let them join their families. We should not let enemies criticize or laugh at us ... for keeping our people in jail," he said.