The hardline president told a meeting of clerics in the central city of Qom that Iran's "enemies" planned to kill him when he went to Baghdad in March, according to the president's Web site. Iranian leaders usually use the term "enemies" to refer to Western nations and the United States in particular.
The report on the presidential Web site did not specify the United States as the source of the plot. But state television reported that Ahmadinejad had "unveiled a shocking story" - that "Americans had intended to kidnap him during his trip to Iraq."
Ahmadinejad said the plot was never carried out because of "intentional" last-minute changes in his schedule during the visit, the Web site said. He said the conspirators learned about the changes too late, when he had departed Iraq.
Ahmadinejad's trip to Baghdad was the first by an Iranian leader since the 1979 Islamic Revolution in Iran, a sign of the close ties between Tehran and the Shiite-led government in Baghdad.
During his visit, Ahmadinejad did not stay in the heavily fortified Green Zone, where the Iraqi government and U.S. Embassy are centered and where most visiting dignitaries reside. Instead, he stayed in a compound that includes the home of President Jalal Talabani, a Kurd, and Abdul-Aziz al-Hakim, head of Iraq's largest Shiite party, both of whom have strong ties to Tehran, the security official said. His security was provided by members of the Shiite Badr Movement, close to al-Hakim, and Kurdish peshmerga fighters, instead of army or police, the official said.
Iran and the U.S have no diplomatic relations since shortly after the 1979 storming of the U.S. Embassy by militant students who held Americans hostages for 444 days.
Tensions have been high between Washington and Tehran over U.S. accusations that Iran aims to build a nuclear weapon and that it is financing and arming anti-U.S. Shiite militias in Iraq. Iran denies both charges.