TEHRAN  Iran’s supreme leader, Ayatollah Ali Khamenei, sternly cut off any compromise over the nation’s disputed elections on Friday. In a long and hard-line sermon, he declared the elections valid and warned of violence if demonstrators continue, as they have pledged, to flood the streets in defiance of the government.

Opposition leaders who failed to halt the protests, he said, “would be responsible for bloodshed and chaos.” The tough words seemed to dash hopes for a peaceful solution to what defeated candidates and protesters call a fraudulent election last week, plunging Iran into its gravest crisis since the Islamic Revolution in 1979.

“Flexing muscles on the streets after the election is not right,” he said, before tens of thousands of angry supporters at Tehran University. “It means challenging the elections and democracy. If they don’t stop, the consequences of the chaos would be their responsibility.”

But opposition leaders, who stayed home Friday, called for yet another huge rally on Saturday afternoon, setting the stage for a possible showdown between protesters and security forces, perhaps a violent one.