After a hotly contested election pitting President Mahmoud Ahmadinejad against leading challenger Mir Hossein Mousavi, the government declared Ahmadinejad the winner on June 13. Mousavi's supporters took to the streets to protest the results, and were met with harsh security crackdowns.

TEHRAN, Sept. 11 -- Iran's supreme leader warned opposition groups Friday that they face a "harsh response" if they maintain what he described as their confrontational course against the government.

In a sermon at traditional Friday prayers, Ayatollah Ali Khamenei said patience with enemies is an important virtue, Iranian state television reported. But when patience runs out, he told the crowd, confrontation is the only option.

Khamenei, the Islamic republic's highest-ranking leader, said that those who disagree with the state would be tolerated but that people who challenge the political system, "brandishing their swords," would be opposed with force.

Offering indirect advice to defeated presidential candidates Mir Hossein Mousavi and Mehdi Karroubi, who are leading a movement that disputes the results of Iran's June 12 election, Khamenei drew a line between acceptable and unacceptable criticism:

"The system will not take action against anyone as long as they perform within the framework of the system, do not resort to violence, do not disturb the calm in society and do not carry out unlawful actions such as spreading lies and rumors."

Khamenei did not name Mousavi or Karroubi in his sermon but made it clear he was referring to them, calling them known members of Iran's political inner circle. "Hopefully, they will remain there," the ayatollah said. Mousavi served as prime minister for eight years during the 1980s, and Karroubi, a Shiite cleric, is a former speaker of parliament.

The two opposition leaders have called for demonstrations against President Mahmoud Ahmadinejad's officially certified reelection and claimed that security forces have raped and killed protesters. They have also accused hard-line clerics and Revolutionary Guard Corps generals of attempting a silent takeover of the country.

Ahmadinejad and his supporters among Revolutionary Guard commanders, prayer leaders and lawmakers deny the accusations. They have repeatedly called for the arrest and trial of Mousavi and Karroubi for what they say was an attempt to initiate a foreign-backed uprising.

On Tuesday, security officials arrested two close aides to both men and seized evidence that the aides had gathered to back allegations of rapes and killings in prison and a high death toll in the recent unrest. Mousavi and Karroubi contend that far more people were killed by security forces in the protests than the government reported. The opposition has backup files of the evidence, Karroubi said Thursday in a complaint letter to the judiciary.

Khamenei's warnings came as Karroubi urged people to continue protesting the government during state-encouraged pro-Palestinian demonstrations next Friday.

Mousavi said the latest arrests were ominous. On a Web site linked to him, he warned, "Dangerous days are ahead."