TEHRAN (Reuters) - Iranian Supreme Leader Ayatollah Ali Khamenei told visiting Russian President Vladimir Putin on Wednesday that Tehran and Moscow must step up cooperation to isolate the United States and help stabilize the Middle East, state TV reported.

(L-R) Russia's President Vladimir Putin, Iran's President Hassan Rouhani and Azerbaijan's President Ilham Aliyev pose for a picture during a meeting in Tehran, Iran November 1, 2017. Sputnik/Alexei Druzhinin/Kremlin via REUTERS

Iran and Russia are the main allies of Syrian President Bashar al-Assad, while the United States, Turkey and most Arab states support rebel groups fighting to overthrow him.

Putin met Iranian political leaders in an effort to nurture a warming relationship strengthened since U.S. President Donald Trump threatened recently to abandon the international nuclear deal with Iran reached in 2015.

“Our cooperation can isolate America ... The failure of U.S.-backed terrorists in Syria cannot be denied but Americans continue their plots,” Khamenei told Putin, according to Iranian state television.

Since Russia’s military intervention in Syria’s war in 2015, and with stepped-up Iranian military assistance, Assad has taken back large amounts of territory from rebels as well as swathes of central and eastern Syria from Islamic State militants.

Moscow is now trying to build on that success with a new diplomatic initiative, including a congress of Syria’s rival parties it plans in the Black Sea resort of Sochi on Nov. 18, though a major opposition bloc has refused to take part.

Pragmatist Iranian President Hassan Rouhani echoed Khamenei, saying Iran and Russia together could tackle “regional terrorism” - an allusion to Sunni Muslim armed groups hostile to Iran, Assad and many other Arab states.

“Our cooperation has helped the fight against terrorism in the region ... Together we can establish regional peace and security,” Rouhani said in a televised joint press conference with Putin and Azerbaijan President Ilham Aliyev, who took part in a three-way summit in Tehran.

Slideshow ( 8 images )

RAPPROCHEMENT

The rapprochement between Iran and Russia is worrying for both Saudi Arabia, Shi’ite Muslim Tehran’s main Sunni rival for dominance in the Middle East, and the United States. Putin praised cooperation with Iran as “very productive”.

“We are managing to coordinate our positions on the Syrian issue,” Putin said.

Moscow is also an important ally for Iran in its renewed confrontation with the United States, where Trump broke ranks with major allies on Oct. 13 by de-certifying Tehran’s nuclear deal with six world powers including Washington under his predecessor Barack Obama.

Trump has called the agreement “the worst deal ever negotiated” and branded Iran a “terrorist nation” for involvement in conflicts in the Middle East.

“We oppose any unilateral change in the multilateral nuclear deal,” Putin told Khamenei, Iranian state TV reported.

Russia has criticized Trump’s disavowal of the nuclear agreement, which has opened a 60-day window for the U.S. Congress to act to reimpose economic sanctions on Iran. These were lifted under the 2015 accord in return for Tehran curbing nuclear activity of potential use in developing an atomic bomb.

“This is a very important visit (by Putin) ... It shows the determination of Tehran and Moscow to deepen their strategic alliance ..., which will shape the future of the Middle East,” an Iranian official told Reuters on condition of anonymity.

“Both Russia and Iran are under American pressure ... Tehran has no other choice but to rely on Moscow to ease the U.S. pressure,” said the official.

Another Iranian official said Trump’s hawkish Iran policy had united the Islamic Republic’s often feuding leadership - split into hardline conservative, pragmatist and reformist factions - in alignment with Russia.

During Putin’s visit, Russian oil producer Rosneft and the National Iranian Oil Company agreed an outline deal to work on a number of “strategic” projects in Iran together worth up to $30 billion.

The deal appeared to dovetail with Putin’s strategy to reassert Russian political and economic influence in the Middle East that faded after the 1991 collapse of the Soviet Union.