Iraqi Prime Minister Nuri al-Maliki arrived in Iran on Wednesday, state television reported, for two days of talks that will also focus on the conflict raging in Syria.
It is Maliki's first visit to Tehran since Hassan Rouhani, a relative moderate who champions engagement with the West, became Iran's president in August after defeating a pool of conservative candidates in a June election.
Maliki's spokesman Ali Mussawi told AFP in Baghdad the premier's talks would focus on energy cooperation and "the necessity of fighting terrorism".
Iran is a key ally of Syrian President Bashar al-Assad, while Iraq has suffered from a surge in attacks by the Islamic State of Iraq and the Levant (ISIL), an Al-Qaeda affiliate battling Assad's regime.
ISIL has exploited the chaos in Syria and launched attacks on both sides of Syria's border with Iraq.
"The meeting touched on Syria and the two sides said the solution should be peaceful and a military option does not represent a solution," Mussawi said of Maliki's talks on Wednesday.
"Both sides said that there should be cooperation in order to reach a peaceful solution."
Maliki said, according to Mussawi: "The whole world should unite in confronting terrorism."
Signup to our newsletter and follow us on Facebook and Twitter!
Iran's official IRNA news agency said Maliki was to meet supreme leader Ayatollah Ali Khamenei, Rouhani, parliament speaker Ali Larijani and Foreign Minister Mohammad Javad Zarif.
However, Mussawi said a Maliki-Rouhani meeting was not on the agenda.
During his trip, Maliki is also due to visit Mashhad, a Shiite pilgrimage city in the northeast revered by the majority communities in both countries.
Iran and Iraq are important trading partners. Tehran signed a contract to export gas to Baghdad in July, in a deal worth $3.7 billion (2.7 billion euros) a year.
However, the neighbours are also at odds over the next secretary general of the Organisation of Petroleum Exporting Countries (OPEC), with both fiercely backing their respective candidates in a vote which began in Vienna on Wednesday.
Another topic likely to be raised is Iraq hosting former rebels of the People's Mujahedeen Organisation of Iran at a camp near Baghdad.
The PMOI was founded in the 1960s to oppose the shah of Iran and later the country's clerical rulers, and set up camp in Iraq during Saddam Hussein's war with Iran in the 1980s.
The group was disarmed after the US-led invasion of Iraq in 2003, and today's Shiite-led, Tehran-friendly government in Baghdad is eager to see it move elsewhere.