"Some people want democracy only for their own sake," he said, referring to his critics both inside and outside of Iran.
"Some want elections, freedom, a sound election. They recognise it only as long as the result favours them."
He said Iranians were united, but with 40 million people taking part it in the election it was natural for some to be disappointed.
Clashes between the police and anti-Ahmadinejad protesters continued on Sunday, with several parts of the city sealed off by the authorities to prevent the unrest spreading.
Earlier, Mr Ahmadinejad told reporters that the debate over
Iran's nuclear programme
"belongs to the past", and that Iran had "embraced" the idea of an international effort to eliminate nuclear weapons.
Global reaction to the election has been muted, but US Vice-President Joe Biden told broadcaster NBC he had doubts about the result.
Violent clashes have continued for most of the weekend
"There's an awful lot of questions about how this election was run, but we'll see, we're just waiting to see, we don't have a enough facts to make a firm judgement," he said.
Mr Ahmadinejad's closest rival in the election campaign, Mir Hossein Mousavi, announced on Sunday he had lodged an official appeal appeal against the result to
Iran's Guardian Council
"I urge you, Iranian nation, to continue your nationwide protests in a peaceful and legal way," he said in a statement.
Mr Mousavi has called several times for his supporters to avoid violence, but angry protesters have been setting light to vehicles and throwing stones in Tehran.
Reuters reported that police charged a 2,000-strong group of students who were protesting at the University of Tehran.
Dozens of activists have been arrested, with reports saying those detained were members of pro-reformist political parties which had backed Mr Mousavi during the election campaign.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.