TEHRAN – Iran's Supreme Leader Ayatollah Ali Khamenei on Friday demanded an end to street protests that have shaken the country since a disputed presidential election a week ago and said any bloodshed would be their leaders' fault.

(EDITORS' NOTE: Reuters and other foreign media are subject to Iranian restrictions on their ability to report, film or take pictures in Tehran.)

He defended Mahmoud Ahmadinejad as the rightful winner of the presidential vote and denied any possibility that it had been rigged, as Ahmadinejad's opponents have asserted.

If there is any bloodshed, leaders of the protests will be held directly responsible, Khamenei declared in his first address to the nation since the upheaval began.

The result of the election comes from the ballot box, not from the street, the white-bearded cleric told huge crowds thronging Tehran University and surrounding streets for Friday prayers. Today the Iranian nation needs calm.

He said any election complaints should be raised through legal channels. I will not succumb to illegal innovation, he said, in an apparent reference to the street protests, which have few precedents in the Islamic Republic's 30-year history.

Mousavi has called for annulment of the election result, which showed Ahmadinejad the winner with nearly 63 percent of the vote to 34 percent for his closest challenger.

Iran's top legislative body, the Guardian Council, is considering complaints by the three losing candidates, but has said only that it will recount some disputed ballot boxes.

START OF DICTATORSHIP

It's a wrong impression that by using street protests as a pressure tool, they can compel officials to accept their illegal demands. This would be the start of a dictatorship, Khamenei said.

He said the enemies of Iran, the world's fifth biggest oil exporter, were targeting the legitimacy of the Islamic establishment by disputing the outcome of the election.

The supreme leader, Iran's ultimate authority, in theory stands above the factional fray, but Khamenei acknowledged that his views on foreign and domestic policy were closer to those of Ahmadinejad than to those of the hardline president's foes.

He attacked what he called interference by foreign powers which had questioned the result of the election.

American officials' remarks about human rights and limitations on people are not acceptable because they have no idea about human rights after what they have done in Afghanistan and Iraq and other parts of the world. We do not need advice on human rights from them, he said.

Many European countries and international human rights organizations have criticized the election and its aftermath, but U.S. President Barack Obama's administration has muted its comments to keep the door ajar for possible dialogue.

People chanting slogans and holding posters of Khamenei, Ahmadinejad and the late Ayatollah Ruhollah Khomenei, the father of the 1979 Islamic revolution, packed streets outside the university.

At least one police helicopter hovered overhead.

Khamenei's speech followed six days of protests by Mousavi supporters. On Thursday, tens of thousands of black-clad marchers bore candles to mourn those killed in earlier rallies.

Iranian state media have reported seven or eight people killed in protests since the election results were published on June 13. Scores of reformists have been arrested and authorities have cracked down on both foreign and domestic media.

Ahmadinejad has been our president for four years, and during this time he has always told the truth to our people, said Javid Abbasirad, 48, outside Tehran university gates.

At the same venue, hundreds of university students had demonstrated in support of Mousavi on Sunday, hurling stones at riot police trying to disperse protesters outside the gates.

Some in the crowd for Friday prayers were draped in Iranian flags. Others held placards with anti-Western slogans.

Don't let the history of Iran be written with the pen of foreigners, one flyer said, reflecting official Iranian anger at international criticism of the post-election violence.

(Additional reporting by Dominic Evans and Hossein Jaseb in Tehran; Editing by Alistair Lyon and Charles Dick)