Supporters of Mr Ahmadinejad are also vocal backers of the ayatollah
Iran's Supreme Leader is addressing the nation for the first time since disputed election results sparked huge protests in the capital, Tehran.
Ayatollah Ali Khamenei, who backs the re-election of President Ahmadinejad, said all the candidates were faithful supporters of the state.
He appealed for calm and urged Iranians to remain devout.
Thousands of people packed into Tehran University - scene of recent clashes - to hear him speak.
The opposition has called off a rally planned for later, after four straight days of demonstrations.
The BBC's Jon Leyne in Tehran says the ayatollah's address after Friday prayers is going to be a crucial moment in the crisis.
LATEST FROM TEHRAN
The government needs to turn out as many people as possible - to show they can rally as many supporters as the opposition - so they've been putting out appeals on state media constantly, offering free transport, calling on people to turn up, not just to Friday prayers but to an "anti-riot rally", as they describe it.
From the Supreme Leader the key thing is, which way does he go - does he offer a message of conciliation, and is that followed up by conciliatory gestures, or conversely, does he go for a very hardline message which will signal a crackdown?
It will be the first public appearance by the supreme leader since he gave his unequivocal backing to the election result and President Ahmadinejad.
Everyone in Iran will be watching to see whether Ayatollah Khamenei offers a message of conciliation to the opposition, or signals the major crackdown many people fear.
Under the republic's constitution, the supreme leader has unfettered power to run the country and shape policy.
The Ayatollah's appearance follows days of rallies by backers of presidential rival Mir Hossein Mousavi, who believe the vote was fixed.
On Thursday, more than 100,000 people attended a "day of mourning" rally in Tehran, called by Mr Mousavi, to commemorate up to eight people killed during protests earlier in the week.
A protest planned for Friday has been called off, but the opposition says it will return to the streets on Saturday.
The rallying cry of the protesters has been "death to the dictator" - a chant surely directed at Ayatollah Khamenei, our correspondent says.
Whether the protesters understand it or not, he says, they are implicitly challenging the whole system.
Hundreds of thousands of Mr Mousavi's supporters have taken to the streets this week in several mass rallies - the biggest protests in the Islamic republic's 30-year history.
Those who died were killed when the protesters surrounded a compound occupied by a militia that backs the government on Monday.
And the unrest has spurred the authorities to clamp down on dissent by blocking websites, restricting journalists and arresting dozens - possibly hundreds - of activists they regard as opponents.
Mr Mousavi and two other candidates in the election have made more than 600 complaints to the Guardian Council - the main electoral authority.
The objections include a shortage of ballot papers, voters being pressurised to support a particular candidate and the barring of candidates' representatives from polling stations.
The council has invited the three to a meeting to discuss their objections on Saturday.
Mr Ahmadinejad defended his election win in a televised address on Thursday - which correspondents say is a sign he is taking the protesters more seriously.
"In this election, victory belonged to 70 million Iranians and the 40 million who took part in voting. Everyone is a winner," he said.
Are you in Iran? What do you think of the current situation? What do think of Ayatollah Ali Khamenei's speech? If you have any information you would like to share with the BBC you can do so using the form below:
Send your pictures and video to firstname.lastname@example.org or text them to +44 7725 100 100. If you have a large file you can upload here.
Read the terms and conditions
At no time should you endanger yourself or others, take any unnecessary risks or infringe any laws.
The BBC may edit your comments and not all emails will be published. Your comments may be published on any BBC media worldwide.