(CNN) Russian President Vladimir Putin arrived in Iran on Tuesday for his first international trip beyond the borders of the former Soviet Union since launching his invasion of Ukraine, which effectively ruptured ties with the West.
Putin met with Iranian President Ebrahim Raisi in Tehran, and with Turkish President Recep Tayyip Erdogan. He also met with Iran's Supreme Leader Ayatollah Khamenei on Tuesday.
"I am very pleased to be on the hospitable Iranian soil...We can boast about record figures in terms of trade growth," said Putin in a bilateral meeting with Raisi. "We are strengthening our cooperation on international security issues, making a significant contribution to the settlement of the Syrian conflict."
Raisi also hailed a "significant" commitment to security cooperation between the two countries, saying the two countries had "good experience" in fighting terrorism.
Also on Tuesday, Iran's national oil company signed a $40 billion agreement with Russia's state-run gas company Gazprom, according to a statement from Shana, the news agency for Iran's oil ministry. The deal includes development of Iranian gas fields and building new gas export pipelines.
Khamenei meanwhile hailed mutual cooperation between Russia and Iran as "deeply beneficial."
"World events show Iran and Russia's need for increasing mutual cooperation," he said in a statement.
Referring to Putin's war in Ukraine, Khamenei also said the expansion of western security alliance NATO had to be "stopped."
"NATO is a dangerous entity. The West is totally opposed to a strong, independent Russia. If the way is opened for NATO, it will recognize no limits," Khamenei said. "If it hadn't been stopped in Ukraine, it would have later started a similar war in Crimea."
Russia's relationship with Iran has alerted Western officials as Putin prepares to ramp up ground offensives in eastern Ukraine following his troops' capture of the Luhansk region.
Recently declassified US intelligence indicates that Iran is expected to supply Russia with "hundreds" of drones -- including weapons-capable drones -- for use in the war in Ukraine, with Iran preparing to begin training Russian forces on how to operate them as early as late July, according to White House officials.
"Russia turning to Iran for the help speaks volumes about the degree to which both nations, for their actions into different areas of the world, have been increasingly isolated by the international community," the National Security Council coordinator for strategic communications John Kirby told CNN last week.
The meeting also comes amid stalled talks to revive the Iran nuclear deal, whose original signatories include the US, UK, France, China, Russia and Germany.
Robert Malley, the US Special Envoy for Iran, told CNN on Monday that the likelihood of reviving the 2015 deal "diminishes by the day."
Among the discussion topics between Putin and Erdogan was the issue of grain exports from Ukraine. The Ukrainian government has accused Russia of blocking the shipment of more than 20 million tons of grain.
Putin thanked Erdogan for his efforts to mediate between the two nations. "With your mediation, we have moved forward," he said. "Not all issues, however, have been resolved. But what was is already good."
Erdogan said that diplomatic conversations between the two nations have continued.
"It's a great advantage that we are able to do so," Erdogan said, adding that in the context of Turkey's role as a mediator, he is "confident that Russia's approach continues to be positive."
Putin's visit comes after Erdogan -- the leader of NATO member Turkey -- repeated his threat to block the ascension of Sweden and Finland to the alliance, after conditionally agreeing to green light their bid in June.
"I would like to remind you once again that we will freeze the process if they do not take the necessary steps to fulfill our conditions," Erdogan said Monday after a cabinet meeting.
He had lifted his opposition to the expansion at a NATO summit last month -- a major diplomatic breakthrough that provided a blow to Putin.
Ahead of the summit, Iran's Khamenei warned Erdogan not to start a military operation in the north of Syria, state news agency IRNA also reported.
"A military attack in the north of Syria would be to the detriment of Turkey and benefit terrorists," Khamenei reportedly told Erdogan in Tehran.
Erdogan has previously threatened to launch a new military offensive designed to push back Syrian Kurdish fighters belonging to the YPG, which Turkey views as a terrorist organization.
"This move would definitely harm Syria, Turkey and the region and it will not create the expected political action by the Syrians," Khamenei warned.
"The Syrian issue should be resolved through negotiations and Iran, Turkey, Syria and Russia will carry out discussions on this issue," he added.
Raisi also called for foreign forces to leave Syria and blamed instability on the "occupying forces of the US."
"We believe it is only the Syrian nation who should make a decision about their internal affairs, without the interference of other countries," he said.
The only possible solution to the Syrian conflict is a political one, he said, adding that military action would worsen the security situation.