At ease, he parried with reporters, sitting alone at a simple table Monday inside the Iraqi presidential compound here. The visiting Iranian patiently called on raised hands without even the benefit of a host, like a benevolent schoolteacher conversing with his students.
Here was a question about U.S. accusations of Iranian meddling in Iraq.
"We discussed with the Iraqi side the issues that serve the interests of the two countries," he said. "We are not committed to answer the demands of others."
Here was another about whether Shiite Muslim Iran would cultivate ties with Iraq's Sunni groups as well as with the Shiite political parties and Kurdish militias it once sheltered and nurtured to fight Saddam Hussein's regime.
"Our relations with all the factions in Iraq are good," he said. "This [distinction] may be important for the foreigners. But we view things differently."
Through tone and body language, Ahmadinejad's message during his historic two-day visit was clear. The United States does not belong in Iraq; Iran does. Iran can and will help in the reconstruction of Iraq, a point underscored by the signing of seven memorandums of understanding between the two countries.
Meanwhile, he suggested, Americans should take their money and get out.
Ahmadinejad made these points without ambiguity, despite promising his hosts he would avoid making incendiary remarks about the U.S. presence.
"Peace and stability will return to the region if the foreigners leave," he told reporters. "We believe the powers that came from overseas thousands of miles away must leave this region and leave the issues in the hands of the locals. If they claim that they want to spend their money to develop the region, I think it's better to spend this money in their own country."
For Ahmadinejad, "foreigner" presumably doesn't include Iranians.
Responding to his visit, White House officials repeated past charges that Iranians are arming and training militant groups in Iraq.
The United States was intercepting "equipment and people coming in from Iran into Iraq with no other purpose but for the killing of innocent Americans and innocent Iraqis, and the destabilization of that country," said National Security Council spokesman Gordon Johndroe aboard Air Force One en route to Washington. "So we would just urge them to stop that."
During his visit, which ended Monday, Ahmadinejad spoke repeatedly of Iran's long ties to Iraq, the interconnectedness of the two countries, which fought an eight-year war in the 1980s but have numerous religious and cultural overlaps.
Ahmadinejad followed a decidedly different diplomatic choreography from the trips of President Bush or British prime ministers. Rather than Ahmadinejad flying in secretly and unannounced, his trip was trumpeted weeks ago.
Rather than travel around the country by Black Hawk helicopter, Ahmadinejad drove about in a motorcade. Instead of feasting on pot roast with U.S. troops, he visited the immaculately decorated, gold-domed shrine of Imam Kadhim, the Shiite saint martyred in the 9th century, where he was received by the mosque's elders as well as a smattering of surprised ordinary Iraqis.
He mostly stayed out of the heavily fortified Green Zone and visited not only Iraqi President Jalal Talabani, Prime Minister Nouri Maliki and Foreign Minister Hoshyar Zebari, but the offices of Abdelaziz Hakim, head of the main Shiite political party.
Though security concerns precluded him from hobnobbing with many ordinary people, as Iranian diplomats in Baghdad often do, he spent a lot of time mingling with Shiite and Kurdish political leaders, some of whom he addressed by their first names.
And rather than shying away from the media, as U.S. officials often do, Ahmadinejad made four press appearances in a 36-hour visit.
"Two months of preparations were made for your visit to Iraq," a reporter said to Ahmadinejad at Monday's media event in Talabani's compound, which was broadcast live on most Iraqi television channels.
"But the foreigners come secretly and discreetly. You came and stayed two days. Why?"
Ahmadinejad broadened his smile and nodded as the reporter finished the question.
"We lived with each other for hundreds of years," he replied. "Visits must be made openly. You should ask [the foreigners] why they make their visits secret."
Times staff writer James Gerstenzang aboard Air Force One contributed to this report.