Saudi Arabia and Iran have reached an agreement to resume diplomatic relations, they announced in a joint statement with China on Friday.
Riyadh and Tehran will reopen embassies and consulates within the next two months, they said.
Iranian and Saudi foreign ministers will meet to begin arranging the exchange of ambassadors and discuss ways to strengthen the renewed relations, said the statement.
The countries also agreed to reactivate a 2001 security co-operation agreement and 1998 deals on the economy, trade, investment, technology, science, culture, sports, and youth.
Saudi and Iranian delegations reached the deal over the past week in Beijing, said officials.
“As a result of the talks, Iran and Saudi Arabia agreed to resume diplomatic relations and re-open embassies … within two months,” Iran's state news agency Irna reported.
Saudi Foreign Minister Prince Faisal bin Farhan said the resumption of diplomatic relations between Riyadh and Tehran comes as part of the kingdom’s vision of preferring political solutions and dialogue, and its keenness to uphold this in the Middle East.
“The countries of the region have one destiny and shared values that make it necessary to co-operate to build a model for prosperity and stability for our peoples,” Prince Faisal said.
Saudi Minister of State and national security adviser Musaed Al Aiban said the kingdom's leadership welcomed the initiative of China's President Xi Jinping to “develop” ties between Tehran and Riyadh.
“We value what we have reached and we hope to continue constructive dialogue,” Mr Al Aiban was quoted as saying by state news agency SPA.
'Victory' for peace
China hailed the restoration of ties between the two countries as a “victory” for dialogue and peace.
The restoration of ties is “major good news” in the current turbulent world, the Chinese Foreign Ministry cited China's top diplomat Wang Yi as saying at the close of the talks.
China will continue to play a constructive role in handling hotspot issues in the world today and will demonstrate its “responsibility” as a major nation, Mr Wang said.
The US said it was aware of reports of the deal and hoped it would help end conflict in Yemen and reduce regional tensions.
A Saudi-led coalition intervened at the request of Yemen's internationally recognised government in 2015, after Iran-backed Houthi rebels seized the capital Sanaa.
A US National Security Council official declined to specifically address the agreement, but told The National that “generally speaking” the White House welcomes any efforts that would help end the war in Yemen and de-escalate tensions in the Middle East.
“We have long encouraged direct dialogue and diplomacy to help reduce tensions and reduce risks of conflict,” the US official said.
“In fact, the roadmap announced today appears quite similar to what was discussed between the Saudis and Iranians over multiple rounds of talks held in Baghdad and Muscat in 2021 and 2022.
“We always supported those processes.”
Oman welcomed the trilateral statement on the resumption of diplomatic ties, and Iraq said the agreement was “turning a new page” between Iran and Saudi Arabia.
The three countries thanked Oman and Iraq for hosting talks in 2021 and 2022, although Muscat has never publicly confirmed doing so.
The kingdom broke off ties with Iran in 2016 after protesters invaded Saudi diplomatic posts there. Days earlier, Saudi Arabia had executed a prominent Shiite cleric.
In January, Prince Faisal said Iran’s nuclear research had created a “very dangerous” situation in the region. He made the remarks at the World Policy Conference in Abu Dhabi.
International efforts led by the US, EU, Russia and China to revive a 2015 nuclear deal with Iran — which would see UN inspectors monitor Iran’s nuclear programme in exchange for relaxing trade sanctions — have largely broken down.
“If Iran gets an operational nuclear weapon, all bets are off,” Prince Faisal said in an on-stage interview.