Iran's Supreme Leader endorsed the Ukraine war at the trilateral summit between Russia, Iran and Turkey, while Ankara sought support for its own goals.
Putin met with his Turkish and Iranian counterparts in Tehran on Tuesday ostensibly to discuss Syria, but talks turned to grain shipments and the Ukraine war.
On his first foreign trip outside the former Soviet Union since the invasion, Russia's president received endorsement for the Ukraine war, with Iran's Supreme Leader claiming NATO would have eventually started the conflict.
He also supported Putin's aims in Ukraine, with the Iranian Supreme Leader Ali Khamenei saying at the trilateral summit that the West opposes an “independent and strong” Russia.
Khamenei echoed past claims by Putin that NATO -- which he called a "dangerous creature" -- would have eventually attacked Russia.
“NATO would know no bounds if the way was open to it, and if it was not stopped in Ukraine, it would start the same war using Crimea as an excuse," he was quoted as saying on his website after meeting with Putin in Tehran.
Iran's ageing Supreme Leader said war was a "violent and difficult issue", adding that the "Islamic Republic is in no way happy that civilians get caught up in it."
However, he continued: "Concerning Ukraine, had you [Russia] not taken the initiative, the other side would have taken the initiative and caused the war,”
Putin also met Turkish President Recep Tayyip Erdogan in Tehran to discuss the UN-backed proposal to resume exports of Ukrainian grain to ease the global food crisis.
Erdogan has sought to help broker talks on a peaceful settlement of the Russia-Ukraine war, as well as help negotiations to unblock Ukrainian grain through the Black Sea.
Turkey has found itself on the opposing side to Russia in conflicts in Azerbaijan, Libya and Syria and has even sold lethal drones to Ukrainian forces. But the NATO member has not imposed sanctions on the Kremlin and remains a key potential partner for Moscow.
Grappling with runaway inflation and a rapidly depreciating currency, Turkey also relies on the Russian market.
After making Putin wait before entering the room for talks, Erdogan praised Russia's “very, very positive approach” during last week’s grain talks in Istanbul.
The Turkish President expressed hope that a deal will be made that "will have a positive impact on the whole world.”
Last week, UN, Russian, Ukrainian and Turkish officials tentatively agreed on parts of a deal to ensure the export of 22 million tons of grain and other agricultural products that are trapped in ports amid the war.
A positive meeting between Putin and Erdogan could be a major step toward alleviating a global food crisis that has sent prices of vital commodities like wheat and barley soaring.
Putin's trip to Iran also comes just days after US President Joe Biden’s visited Israel and Saudi Arabia — Tehran’s primary rivals in the Middle East.
"The contact with Khamenei is very important," Yuri Ushakov, Putin's foreign policy adviser, told reporters in Moscow.
"A trusting dialogue has developed between them on the most important issues on the bilateral and international agenda. On most issues, our positions are close or identical."
Also high on the agenda will be peace talks over the war in Syria, where Moscow and Tehran have opposed Turkish threats to increase military activity.
Ushakov said the parties will discuss efforts to encourage a political settlement, while Erdogan is expected to take up Turkey’s threats to drive away US-backed Syrian Kurdish fighters from its borders.
The operation is part of Ankara’s plan to create a safe zone along its border with Syria that would encourage the voluntary return of Syrian refugees.
In a meeting with Erdogan, Khamenei delivered a stern warning against the planned Turkish incursion.
“Any sort of military attack in northern Syria will definitely harm Turkey, Syria and the entire region, and will benefit terrorists,” Iran’s top leader said, stressing the need to “bring the issue to an end through talks.”
Erdogan meanwhile said Ankara expects Russia and Iran “to support Turkey in this fight.”
“The greatest favour that would be made to the Syrian people would be the complete removal of the separatist terrorist organisation from territories that it occupies,” he stated.
Syria meanwhile said on Wednesday that it is formally breaking diplomatic ties with Ukraine in response to a similar move by Kyiv.
Damascus said last month that it would recognise the “independence and sovereignty” of the Russia-backed eastern Ukrainian regions of Luhansk and Donetsk, becoming the first country to recognise the two breakaway states.