"I call on the pious and Hizbollahi guards (hard-line vigilantes) throughout the country not to intervene wherever they see riots," Khamenei said in a speech broadcast on state television.
Dozens of hard-line vigilantes on motorbikes chased down around 300 mostly teenage protesters on Wednesday night, beating them with sticks in the streets outside a Tehran University dormitory in the city's Amirabad district. Several people were seen being carried away with head injuries.
About 200 students in the dormitory compound threw stones and gasoline bombs at police after officers joined the vigilantes in attacking the protesters. The protesters chanted "Death to Khamenei!"
The protests had begun peacefully Tuesday when a small student gathering against privatization of universities turned into the largest demonstration against Iran's political leadership since November, when students protested a death sentence imposed on Hashem Aghajari, a history professor at a Tehran teachers' college, who questioned the need to obey the Islamic clerics' every edict.
Police had arrested about 80 protesters before the clashes broke out. In Iran, criticism of Khamenei is punished by jail, and hard-liners say Khamenei's powers are unlimited and cannot be questioned.
Before the clashes broke out Wednesday, security officials warned that further demonstrations against the political leadership would not be tolerated.
"These people have been provoked by extremists inside the country and elements outside the country to chant illegal slogans," state-run television quoted Intelligence Minister Ali Yunesi as saying Wednesday.
He was apparently referring to satellite channels owned by Iranian opposition groups in exile that have encouraged Iranians to rise up against the ruling clerics. Although satellite dishes are officially banned, many Iranians still use them.
An Intelligence Ministry official, speaking to The Associated Press on condition of anonymity, said people were arrested for chanting slogans against the ruling political leadership and for participating in unauthorized demonstrations.
The identities of the detainees have not been clearly established, the official said, but most of them did not appear to be students.
The arrests may have also been a warning before July 9, when students plan to commemorate the day four years ago when hard-liners and security forces attacked students protesting media restrictions. At least one student was killed and the clash touched off the worst street battles since the 1979 revolution that ousted the U.S.-backed shah.
Students were key supporters of the Iranian president, Mohammad Khatami, who was elected in 1997 on a reform agenda but whose efforts at liberalization have been stymied by conservative clerics, who control important institutions, especially the judiciary.
In the United States, conservatives calling for a policy of regime change toward Tehran say frustration over blocked reforms would fuel a popular revolt, if the U.S. supported one.