Ahmadinejad's opponents in the 290-seat assembly dominated by conservatives wanted to question him about an economic crisis that they blame as much on his mismanagement as on Western sanctions over Iran's nuclear program.
Economic woes have forced up prices of goods, diminished the value of the Iranian currency and exacerbated divisions within Iran's factionalized political system.
"Up to this point, the plan to question the president has been positive because of the sense of responsibility of parliament and the readiness of government officials," said Khamenei, the 73-year-old cleric who holds ultimate power.
"But if this issue goes any further, it will be what the enemies want and so I ask the honorable representatives not to continue with it," the Mehr news agency reported him saying.
Seventy-seven lawmakers had backed the plan to grill Ahmadinejad and questions were expected to focus on the currency fluctuations and what they said was the mistaken allocation of limited government-subsidized dollars, including for the import of thousands of foreign cars.
A spokesman for the group, Avaz Heydarpour, confirmed that the summons had been withdrawn following Khamenei's request, Mehr reported.
Once the favored presidential candidate of Iran's hardliners who backed his re-election over reformists at a disputed 2009 election, Ahmadinejad has fallen from favor within the deeply factionalized conservative ranks that rule the Islamic Republic.
In March, he became the first president in the history of the Islamic Republic to be called before the legislature and had looked likely to have to relive the humiliating experience.
During an hour-long session, he responded in a confident and at times flippant tone to questions about his economic record and his allegiance to Khamenei. Lawmakers said they were left baffled and angered by his performance.
In recent weeks, he has fired back at the judiciary and legislature, bringing into full public view a feud between himself and the powerful Larijani brothers, Ali, the parliament speaker, and Sadeq, the judiciary chief.
In a letter to Sadeq Larijani published in October, Ahmadinejad said the judiciary had unjustly imprisoned his top press aide and that it was acting outside the bounds of Iran's constitution.
(Reporting By Marcus George; Editing by Robin Pomeroy)