Al Jazeera's Alireza Ronaghi, reporting from the Iranian capital, Tehran, said the endorsement puts to rest all doubts about the legitimacy of Ahmadinejad.
"Whether you like it or not, the endorsement of Iran's supreme leader gives the legitimacy within the structure of the Islamic republic to the president who has been elected.
"From now on Ahmadinejad is Iran's official president," our correspondent said.
Ahmadinejad's confirmation comes after a few exceptionally difficult weeks, during which he was forced to drop his choice of vice-president, fired his intelligence minister, had his culture minister quit on him and his industry minister found guilty of fraud.
His confirmation also follows renewed criticism of the Iranian establishment, this time over the trial of more than 100 people accused of rioting in the wake of the disputed June 12 vote.
On Sunday, Mohammad Khatami, who was president of Iran from 1997 to 2005, denounced the trial as "unconstitutional".
Khatami, also a cleric and seen as a reformist, has shown support for the country's opposition movement.
His comments came a day after the suspects, including prominent political figures, appeared before Tehran's revolutionary court on charges of attacking security forces and destroying property.
"What was done yesterday is against the constitution, regular laws and rights of the citizens," Khatami's office quoted him as telling a group of political activists and legislators.
He said the court had relied on "confessions taken under certain circumstances which are not valid".
"The most important problem with the trial procedure is that it was not held in an open session.
"The lawyers and the defendants were not informed of the contents of the cases ahead of the trial."
Mir Hossein Mousavi, the Iranian opposition candidate who lost in the election, said protesters' so-called confessions were obtained by using torture.
"What are they trying to convince people of ... by relying on reports from reporters nobody has heard of and relying on confessions which obviously bore the hallmarks medieval-era torture?" Mousavi said on his website Ghalamnews.
"The torturers' teeth have reached people's bones, and now they're picking [their] victims from among those who have done great services to the country and the Islamic system."
Among those on trial are figures from Iran's reformist movement, including Behzad Nabavi, a former industry minister and deputy speaker of parliament, Abdollah Ramazanzadeh, a former government spokesman and Mohammad Ali Abtahi, a former vice-president.
Farzad Agah, an Iran analyst and former managing director of Iran news watch, told Al Jazeera that most of the charges "seem to be just some kind of a political statement which gives some standard accusations, which they have always stated against opposition figures and opposition protesters".
About 20 people were killed and hundreds wounded in the violence that followed the re-election of Ahmadinejad.
The opposition denounced the election as fraudulent, saying it was stolen from Mousavi, Ahmadinejad's main rival.
In the days following the vote about 2,000 protesters, reformists, political activists and journalists were detained amid a widespread crackdown by government forces.
|Khatami, left, and Mousavi have condemned the trial of 100 alleged 'rioters' [AFP]
But Iran's government has been unable to choke off the protest movement and sustained domestic and international criticism of its crackdown has prompted the authorities to free hundreds of detainees.
About 250 protesters are still being held.
A prosecutor in the trial said at Saturday's hearing that the opposition was a tool of foreign enemies.
The charges, read out in court by the prosecutor from a 15-page indictment, included attacking military and government buildings, having links with armed opposition groups and conspiring against the ruling system, Iran's official Irna news agency reported.
The indictment described an alleged years-long plot by the top pro-reform political parties to carry out an overthrow of the Islamic Republic.
Opposition groups have denounced the trial, with the Islamic Iran Participation Front calling it "disgusting" and a "ridiculous show".