Annan's two-day visit to Tehran comes after Iran ignored a United Nations deadline to halt uranium enrichment by the end of August, opening the door to possible sanctions.
At a joint news conference with Iran's foreign minister Manoucher Mottaki on Sunday, Annan said "on the nuclear issue, the president reaffirmed to me Iran's preparedness and commitment to hold negotiations" to find a solution to the impasse over Tehran's nuclear activities.
However, Annan said Ahmadinejad "reiterated that he did not accept suspension before negotiations".
The suspension of uranium enrichment is a condition set by the five permanent members of the security council plus Germany.
With regard to the recent ceasefire in Lebanon, Annan said that Ahmadinejad had "reaffirmed his country's support for the implementation of resolution 1701".
Resolution 1701 drew up the terms for the ceasefire, including expanding an existing UN peacekeeping force in Lebanon and calling for an arms embargo on Hezbollah.
Annan said his discussions about the resolution included measures to prevent the rearming of Hezbollah.
But the UN chief did not disclose the specifics of his talks on the topic with the Iranian president.
Annan also reiterated his displeasure over an exhibition in Tehran of cartoons on the Holocaust, drawing attention to the outrage among Muslims caused by the publication earlier this year of the Danish cartoons of Islam's Prophet Muhammad.
The comments came just hours after an Iranian foreign ministry spokesman said Iran plans to hold a conference this autumn questioning the extent of the Holocaust.