Iran's outgoing President Mahmud Ahmadinejad has visited the southern Iraqi cities of Karbala and Najaf, the most sacred cities for Shi'ite Muslims.
Ahmadinejad arrived in Baghdad on July 18 for a two-day official visit.
In Baghdad, he held talks with Prime Minister Nuri al-Maliki and Vice President Khudayr al-Khuzai, as well as the speaker of Iraq's parliament, Osama al-Nujafi.
Iranian state-controlled Press TV reported that during Ahmadinejad's visit the two neighboring countries agreed to explore and develop oil and natural gas fields along their borders.
Ahmadinejad will step down after two terms in office.
Iran will inaugurate President-elect Hassan Rohani on August 3.
Based on reporting by AP and Press TV