Ahmadinejad will hold talks with President Abdullah Gul during his one-day working visit to Istanbul on August 14, which comes after months of lobbying by Tehran.
Turkey has offered to help resolve a dispute between Iran and the West over Tehran's nuclear programme, which Western powers fear is aimed at producing atomic weapons. Ankara has good ties with both neighbouring Iran and the West.
"We are trying to help make Iran and Western countries understand each other well. We view this high level visit as an opportunity for the role we play," the official, who declined to be named, said.
Iran and the representatives of six world powers talked by telephone on Monday but Tehran said it would press ahead with its nuclear programme despite demands that it halt the work.
Turkey and Iran have growing trade ties and are negotiating expanding energy cooperation. Gul and Prime Minister Tayyip Erdogan have also sought to boost Turkey's role as a regional problem solver in the Middle East.
Ahmadinejad's visit, long rumoured but reportedly delayed several times, has caused a stir in officially secular but predominantly Muslim Turkey.
Turkey's secularist establishment, including army generals and judges, view Ahmadinejad with suspicion and previous President Ahmet Necdet Sezer had refused to invite him. Gul, a respected former foreign minister and ex-Islamist, was appointed president last year.
Turkish officials sought to down play media reports about a dispute over whether Ahmadinejad would visit the mausoleum of modern Turkey's revered secularist founder Mustafa Kemal Ataturk.
"Iran is an important country on the world agenda right now, especially discussions on its nuclear programme ... You (media) should focus on the content of the visit rather than the small details," Foreign Minister Ali Babacan told a news conference.
Radical newspaper reported on Saturday that Turkish authorities had been forced to move the Iranian leader's visit to Istanbul and make it a working trip rather than an official visit because he did not plan to visit Ataturk's burial place.