Insulting senior officials is a crime in Iran punishable by a maximum two-year jail sentence.
"Such insults and accusations against the government are a return to Hitler's methods, to repeat lies and accusations ... until everyone believes those lies," the semi-official Fars news agency quoted him as saying.
Ahmadinejad also accused supporters of his main challenger, Mir Hossein Mousavi, of corruption, including former President Akbar Hashemi Rafsanjani.
Rafsanjani responded angrily, calling on the Islamic Republic's supreme leader Ayatollah Ali Khamenei to rein-in Ahmadinejad.
Mousavi, a reformist and former prime minister, accused Ahmadinejad of isolating Iran with his vitriolic attacks on the United States, his combative line on Iran's nuclear policy and his questioning of the Holocaust.
He advocated easing nuclear tension, while rejecting demands that Tehran halt nuclear work which the West fears could be used to make bombs.
Mahdi Karroubi, a reformist and former parliamentary speaker, and Mohsen Rezai, a former commander of the powerful Revolutionary Guard, are also standing in Friday's election.
Sixty-five per cent of Iran's population, or about 46 million people, are eligible to vote
Turnout in the last election was around sixty per cent
Just over 13 per cent, or six million of those eligible to vote, will be first time voters
Three-quarters of the population are under the age of 30 and the voting age is set at 18
"This is the most unpredictable and most exciting presidential election in Iran in years because the main contenders in this race have gathered much support among Iranians," Al Jazeera's Alireza Ronaghi, reporting from Tehran, said.
"It is clearly visible that Mousavi has a little edge over Ahmadinejad in the capital city, but in other provinces it is a totally different story."
Iran's reformists are hoping that a high turnout on Friday will help them oust the conservative Ahmadinejad, who they accuse of increasing the country's international isolation and compounding its economic difficulties.
Mousavi's campaign appears to have motivated the youth in a country where one-third of the electorate is under 30-years-old and therefore not born at the time of the Islamic Revolution in 1979.
"I believe it is a new beginning and I want to take part in it," Parastou Pazhoutan, a 26-year-old Mousavi supporter, said.
"A month ago, I would have said Ahmadinejad was a sure bet,'' Sharif Emam Jomeh, a political analyst, said.
"There was apathy especially with the youth. But now, until 3am, they are out in numbers and they care ... Below the surface, something was boiling."
Part of the appeal of Mousavi has been his wife, who has joined him on the campaign and made vocal calls for improved women's rights.
"We seek freedom of expression, press and thought that are the eternal wishes of Iranian people," she told a rally in Tehran on Tuesday.
The relatively unknown Ahmadinejad surprised everyone with his victory four years ago, and he has enjoyed Khamenei's support throughout his presidency.
Analysts say no candidate is likely to gain the 50 per cent needed for an outright first-round victory, forcing a run-off between the two front-runners a week later.
They say that, even if Mousavi were to defeat Ahmadinejad, there would be no sudden change in relations with the West.
"Things in Iran move slowly. It would mark a significant change, but it wouldn't reflect regime change," said Ali Ansari of the University of St Andrews in Scotland.