Iran and Saudi Arabia agreed on Friday to restore diplomatic ties and reopen embassies after seven years of tensions. The major diplomatic breakthrough negotiated with China reduces the risk of armed conflict between the Middle Eastern rivals – both directly and in proxy conflicts around the region.

The agreement, struck in Beijing this week amid its ceremonial National People’s Congress, represents a major diplomatic victory for the Chinese as Gulf Arab states perceive the US as slowly withdrawing from the Middle East. It also comes as diplomats have been trying to end a long war in Yemena conflict in which both Iran and Saudi Arabia are deeply entrenched.

The two countries released a joint communiqué on the deal with China, brokering the agreement as President Xi Jinping was awarded a third five-year term as leader earlier Friday.

Read more:

China’s Xi Jinping was unanimously awarded the third five-year term as president

The story continues below the ad

Xi, whose administration has in recent days relaunched a campaign to challenge the US-led Western liberal order with warnings of “conflict and confrontation”, was credited in a trilateral statement with facilitating the talks through a “noble initiative” and personally joining on sponsoring the negotiations which took place from Monday to Friday.

Videos showed Ali Shamkhani, secretary of Iran’s Supreme National Security Council, meeting with Saudi National Security Adviser Musaad bin Mohammed al-Aiban and Wang Yi, China’s top diplomat.

The statement calls for the restoration of ties and the reopening of embassies “within a period of no more than two months.” A meeting with their foreign ministers is also planned.

In the video, Wang could be heard saying “wholehearted congratulations” to the “wisdom” of the two countries.

“Both sides have shown sincerity,” he said. “China fully supports this agreement.”

Click to play video: 'UAE calls for 'intense efforts' to reach Yemen ceasefire'

The United Arab Emirates calls for “intense efforts” to reach a ceasefire in Yemen

The UN welcomed the Saudi-Iranian rapprochement and thanked China for its role. “Good neighborly relations between Iran and Saudi Arabia are essential for the stability of the Gulf region,” UN spokesperson Stephane Dujarric said at UN headquarters.

The story continues below the ad

The United States also welcomed “any effort to help end the war in Yemen and reduce tensions in the Middle East region,” White House press secretary Karine Jean-Pierre said. However, the State Department offered a word of caution about a deal in which America appears to have had no role: “Of course, it remains to be seen whether the Iranian regime will honor their side of the deal.”

China, which last month hosted Iran’s hardline president Ebrahim Raisi, is a top buyer of Saudi oil. Xi visited Riyadh in December for meetings with oil-rich Gulf Arab countries that are critical to China’s energy supply. However, it does not provide the same military protection for the Arab Gulf states as America, which makes Beijing’s involvement that much more remarkable.

Iran’s state news agency IRNA quoted Shamkhani as calling the talks “clear, transparent, comprehensive and constructive”.

“Removing misunderstandings and forward-looking views in Tehran-Riyadh relations will definitely lead to improving regional stability and security, as well as increasing cooperation between the Gulf nations and the world of Islam to deal with current challenges,” Shamkhani said.

Read more:

US ‘will not walk away’ from Middle East to remain active, engaged partner: Biden

Al-Aiban thanked Iraq and Oman for mediating between Iran and the kingdom, according to his statements carried by the state-run Saudi Press Agency.

The story continues below the ad

“While we value what we have achieved, we hope that we will continue to pursue the constructive dialogue,” the Saudi official said.

Tensions have long been high between Iran and Saudi Arabia. The kingdom severed ties with Iran in 2016 after protesters invaded Saudi diplomatic posts there. Saudi Arabia had executed a prominent Shiite cleric with 46 others days earlier, sparking the demonstrations.

It came as Crown Prince Mohammed bin Salman, then deputy, began his rise to power. The son of King Salman, Prince Mohammed previously compared Iran’s Supreme Leader Ayatollah Ali Khamenei to Nazi Germany’s Adolf Hitler, and threatened to strike Iran.

Since then, the US unilaterally pulled out of Iran’s nuclear deal with world powers in 2018. Iran has been blamed for a series of attacks since then, including one targeting the heart of Saudi Arabia’s oil industry in 2019, temporarily halving the kingdom’s crude output.

Click to play the video:

US imposes new sanctions on 10 more Iranian officials

Although Yemen’s Iran-backed Houthi rebels initially claimed the attack, Western nations and experts blamed Tehran. Iran denied it and also denied carrying out other abuses later attributed to the Islamic Republic.

The story continues below the ad

Religion also plays a key role in their relationships. Saudi Arabia, home to the cube-shaped Kaaba to which Muslims pray five times a day, has portrayed itself as the world’s leading Sunni nation. Iran’s theocracy sees itself as the protector of Islam’s Shiite minority.

The two powers have competing interests elsewhere, such as in the turmoil in Lebanon and in rebuilding Iraq after the 2003 US-led invasion that toppled Saddam Hussein.

The leader of the Iranian-backed Lebanese militia and political group Hezbollah, Hassan Nasrallah, said the deal could “open new horizons” in Lebanon, Syria and Yemen. Iraq, Oman and the United Arab Emirates also hailed the agreement.

Click to play the video:

The US says Iran is responsible for the attacks on Saudi oil facilities

Kristian Coates Ulrichsen, a researcher at Rice University’s Baker Institute who has long studied the region, said Saudi Arabia reaching the deal with Iran came after the United Arab Emirates reached a similar deal with Tehran.

The story continues below the ad

“This de-escalation and de-escalation has been going on for three years and this was triggered by Saudi Arabia’s recognition of their belief that without unconditional American support they could not project power against Iran and the rest of the region,” he said.

Prince Mohammed, focused on massive construction projects at home, likely also wants to withdraw from the Yemen war, Ulrichsen added.

“Instability can do a lot of damage to his plans,” he said.

The Houthis captured Yemen’s capital Sanaa in 2014, forcing the internationally recognized government into exile in Saudi Arabia. A Saudi-led coalition armed with American weapons and intelligence entered the war on the side of Yemen’s government-in-exile in 2015. Years of inconclusive fighting created a humanitarian disaster and pushed the Arab world’s poorest nation to the brink of famine.

Read more:

Saudi-led coalition launches operation against Yemen’s Houthis

A six-month ceasefire, the longest in the Yemen conflict, expired in October.

Negotiations have been ongoing recently, including in Oman, a long-standing interlocutor between Iran and the United States. Some have hoped for a deal ahead of the Muslim fasting month of Ramadan, which begins later in March. Iran and Saudi Arabia have held intermittent talks in recent years but it was not clear whether Yemen was the driving force behind this new détente.

The story continues below the ad

Yemeni rebel spokesman Mohamed Abdulsalam appeared to welcome the deal in a statement that also criticized the United States and Israel. “The region needs to return to normal relations between its countries, through which the Islamic society can regain its lost security as a result of the foreign interventions, led by the Zionists and the Americans,” he said.

For Israel, which has wanted to normalize relations with Saudi Arabia even as the Palestinians remain without a state of their own, Riyadh’s easing of tensions with Iran could complicate its own regional calculations.

The government of Israeli Prime Minister Benjamin Netanyahu had no immediate comment on Friday. Netanyahu, under political pressure at home, has threatened military action against Iran’s nuclear program as it enriches closer than ever to weapons-grade levels. Riyadh seeking peace with Tehran takes a potential ally for a strike off the table.

Click to play video: 'Iran sentences three more protesters to death, expert warns regime 'in trouble''

Iran sentences three more protesters to death, expert warns regime ‘in trouble’

It was unclear what this development meant for Washington. Although long considered to ensure energy security in the Middle East, regional leaders have grown increasingly wary of US intentions following its chaotic withdrawal from Afghanistan in 2021.

The story continues below the ad

But the White House pushed back against the idea that a Saudi-Iran deal in Beijing suggests an increase in Chinese influence in the Middle East. “I would strongly push back against this idea that we’re taking a step back in the Middle East — far from it,” said National Security Council spokesman John Kirby.

Mark Dubowitz, director of the Foundation for the Defense of Democracies, which opposes the Iran nuclear deal, said renewed Iran-Saudi relations via Chinese mediation “are a lose, lose, lose for American interests,” noting: “Beijing adores a vacuum .”

But Trita Parsi of the Quincy Institute, which advocates engagement with Iran and supports the nuclear deal, called it “good news for the Middle East, as tensions between Saudi Arabia and Iran have been a driver of instability.” He added that “China has emerged as a player that can resolve disputes rather than simply selling arms to the warring parties,” noting that a more stable Middle East also benefits the United States

Associated Press writers Nasser Karimi in Tehran, Iran, Jack Jeffery in Cairo, Aamer Mahdani, Darlene Superville and Matthew Lee in Washington, Jennifer Peltz in New York and Bassem Mroue and Abby Sewell in Beirut contributed.