In a speech to Parliament later broadcast on state television, Supreme Leader Ayatollah Ali Khamenei said: "While there are weaknesses and problems ... the composition of the executive branch is good and appropriate, and the government is working. The government and parliament must help each other."
But he added, in an apparent warning to the populist president not to stray too far out of line, "When the law is passed, the government must implement it with full power and without any excuse," the Los Angeles Times reported.
Khamenei also warned against interference in next year's parliamentary elections. The disputed presidential race two years ago sparked mass protests that threatened revolution.
Ahmadinejad and the ayatollah's conservative clerical circle have been jockeying for power for months.
Despite Sunday's endorsement, political scientist Ahmad Bakhshayesh said the president, "as a lame duck in power, cannot get more room to maneuver. He is no longer the supreme leader's blue-eyed boy."
Exploding whale video goes viral on Internet
Jordana Brewster on Paul Walker: 'He was an enormous presence in my life'