DUBAI, United Arab Emirates (AP) -- Iran and Saudi Arabia agreed Friday to reestablish diplomatic relations and reopen embassies after seven years of tensions. The major diplomatic breakthrough negotiated with China lowers the chance of armed conflict between the Mideast rivals -- both directly and in proxy conflicts around the region.
The deal, 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 United States slowly withdrawing from the wider Middle East. It also comes as diplomats have been trying to end a long war in Yemen, a conflict in which both Iran and Saudi Arabia are deeply entrenched.
The two countries released a joint communique on the deal with China, which brokered the agreement as President Xi Jinping was awarded a third five-year term as leader earlier Friday.
Videos on Iranian state media showed Ali Shamkhani, the secretary of Iran's Supreme National Security Council, with Saudi national security adviser Musaad bin Mohammed al-Aiban and Wang Yi, China's most senior diplomat.
The joint statement calls for reestablishing ties and reopening embassies to happen "within a maximum period of two months." A meeting by their foreign ministers is also planned.
In the video, Wang could be heard offering "wholehearted congratulations" on the two countries' "wisdom."
"Both sides have displayed sincerity," he said. "China fully supports this agreement."
The United Nations 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," U.N. spokesperson Stéphane Dujarric said at U.N. headquarters.
The U.S. also welcomed "any efforts to help end the war in Yemen and de-escalate tensions in the Middle East region," White House press secretary Karine Jean-Pierre said.
China, which last month hosted Iran's hard-line President Ebrahim Raisi, is also a top purchaser of Saudi oil. Xi visited Riyadh in December for meetings with oil-rich Gulf Arab nations crucial to China's energy supplies.
Iran's state-run IRNA news agency quoted Shamkhani as calling the talks "clear, transparent, comprehensive and constructive."
"Removing misunderstandings and the future-oriented views in relations between Tehran and Riyadh will definitely lead to improving regional stability and security, as well as increasing cooperation among Persian Gulf nations and the world of Islam for managing current challenges," Shamkhani said.
Al-Aiban thanked Iraq and Oman for mediating between Iran and the kingdom, according to his remarks carried by the state-run Saudi Press Agency.
"While we value what we have reached, we hope that we will continue to continue the constructive dialogue," the Saudi official said.
Tensions long have been high between Iran and Saudi Arabia. The kingdom broke 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, triggering the demonstrations.
That came as Crown Prince Mohammed bin Salman, then a 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 U.S. unilaterally withdrew from Iran's nuclear deal with world powers in 2018. Iran has been blamed for a series of attacks after that, including one targeting the heart of Saudi Arabia's oil industry in 2019, temporarily halving the kingdom's crude production.
Though Yemen's Iranian-backed Houthi rebels initially claimed the attack, Western nations and experts blamed Tehran. Iran denied it and also denied carrying out other assaults later attributed to the Islamic Republic.
Religion also plays a key role in their relations. Saudi Arabia, home to the cube-shaped Kaaba that Muslims pray toward five times a day, has portrayed itself as the world's leading Sunni nation. Iran's theocracy, meanwhile, views itself as the protector of Islam's Shiite minority.
The two powerhouses have competing interests elsewhere, such as in the turmoil in Lebanon and in the rebuilding of Iraq following the U.S.-led 2003 invasion that toppled Saddam Hussein.
The leader of the Iranian-backed Lebanese militia and political group Hezbollah, Hassan Nasrallah, said the agreement could "open new horizons" in Lebanon, Syria and Yemen. Iraq, Oman and the United Arab Emirates also praised the accord.
Top Pakistani diplomat Bilawal Bhutto Zardari, chair of the Organization of Islamic Cooperation's Council of Foreign Ministers, praised China for "encouraging dispute resolution, rather than on encouraging perpetual disputes."
Kristian Coates Ulrichsen, a research fellow at Rice University's Baker Institute who long has studied the region, said Saudi Arabia reaching the deal with Iran came after the United Arab Emirates reached a similar understanding with Tehran.
"This dialing down of tensions and de-escalation has been underway for three years and this was triggered by Saudi acknowledgement in their view that without unconditional U.S. backing they were unable to project power vis-a-vis Iran and the rest of the region," he said.
Prince Mohammed, focused on massive construction projects at home, likely wants to pull out of the Yemen war as well, Ulrichsen added.
"Instability could do a lot of damage to his plans," he said.
The Houthis seized Yemen's capital, Sanaa, in 2014 and forced the internationally recognized government into exile in Saudi Arabia. A Saudi-led coalition armed with U.S. weaponry and intelligence entered the war on the side of Yemen's exiled government in 2015. Years of inconclusive fighting created a humanitarian disaster and pushed the Arab world's poorest nation to the brink of famine.
A six-month cease-fire, the longest of the Yemen conflict, expired in October.
Negotiations have been ongoing recently, including in Oman, a longtime interlocutor between Iran and the U.S. Some have hoped for an agreement 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 wasn't clear if Yemen was the impetus for this new detente.