It was the latest in a series of positive remarks he has made about the possibility of direct US-Iranian talks.
Iran's leaders may not know how to react to Mr Obama's overtures, says the BBC's Jon Leyne in Tehran, and it is not certain whether Mr Ahmadinejad's remarks are a rhetorical statement or a genuine opening for talks.
Despite congratulating Mr Obama on his election victory in November, Mr Ahmadinejad later called for the US to apologise for its past "crimes" against Iran and for the US to withdraw all its troops from around the world, in order for talks to be held.
That outburst followed an offer from Mr Obama to extend the hand of friendship to Iran if it "unclenched its fist".
The two countries cut ties in 1979 after Iranian students stormed the US embassy in Tehran and occupied it for 444 days, holding dozens of American diplomats hostage.
Iranians hold a rally marking the 30th anniversary of the Islamic revolution
For the last 30 years, Iranian officials have regularly referred to the US as the "Great Satan".
Relations have worsened further in recent years as the US has led efforts to prevent Iran from further developing its nuclear programme, which some Western nations fear will lead to nuclear weapons.
Tehran says its nuclear programme is for civilian, energy-generating purposes only.
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.