"Elections were clearly competitive," Khamenei said. "Different parties and individuals participated under various banners... and expressed their views," he said.
The February 26 vote was for parliament and the Assembly of Experts, a powerful clerical body that oversees the work of the supreme leader and would choose a replacement if he dies.
"Elections were healthy ... exactly the opposite of what our enemies have claimed over the years," Khamenei said in a meeting with outgoing members of the assembly.
He urged them to be "vigilant" and to fulfil their duties.
"In one word, the Assembly of Experts must remain revolutionary, think revolutionary and act revolutionary."
The elections were the first since a landmark nuclear deal between world powers and Iran that was implemented in January, leading to the lifting of sanctions.
Thousands of candidates, including many reformists, were initially disqualified from running, but that was later partially reversed.
Although no single political grouping won a majority in the 290-seat parliament, the polls curbed its conservative dominance.
Signup to our newsletter and follow us on Facebook and Twitter!
The List of Hope alliance between pro-Rouhani reformists and moderates won all 30 parliamentary seats for Tehran.
Rouhani and former president Ayatollah Akbar Hashemi Rafsanjani, another moderate, came third and first in the Tehran election to the assembly.
Tehran voters also removed two hardline ayatollahs, assembly chairman Mohammad Yazdi and Mohammad Taghi Mesbah-Yazdi, a former close adviser to ex-president Mahmoud Ahmadinejad.
Khamenei praised the "very graceful" behaviour of candidates who lost.
He contrasted that with "the disgraceful behaviour of those who were not elected in 2009 and started fights and dragged people to the streets."
Reformists said that ballot was rigged and their two defeated candidates, Mir Hossein Mousavi and Mehdi Karroubi, have been under house arrest since 2011, accused of "sedition" against the regime.
A second round of legislative elections is expected in April to determine the fate of 69 seats that have no clear winners yet.
Khamenei also repeated his warning about Western "infiltration" of the country.
"We should have relations with the whole world, except the US and the Zionist regime, but we should also know that the world is not limited to the West and Europe," he said.