US and Israel will be wary after secret Beijing talks see Saudi Arabia and Iran resume ties after seven years
Saudi Arabia and Iran have announced they will resume ties after years of hostility.
The news follows four days of secret talks in the Chinese capital Beijing and will be seen as a major step towards stability in the Middle East.
The agreement was signed by Iran's top security official and Saudi Arabia's national security adviser and has been described by the top Chinese diplomat Wang Yi as "a victory for dialogue and peace".
As a result, Tehran and Riyadh will re-open embassies in the respective capitals within two months, respect each other's sovereignty and agree not to interfere in internal affairs.
They will also reactivate a 2001 security accord.
The two Middle East powers broke off relations seven years ago after the Saudi embassy in Tehran was stormed by protesters in 2016 following the execution of a Shi'ite cleric.
Since then, Iran has supported the Houthi militia in their conflict against the Saudi-backed government in Yemen, and Saudi Arabia has accused Iran of attacking tankers in the Gulf.
Iran has always denied the allegations.
The Iranian foreign minister Hossein Amirabdollahian welcomed the agreement, tweeting: "The neighbourhood policy, as the key axis of the Iranian government's foreign policy, is strongly moving in the right direction and the diplomatic apparatus is actively behind the preparation of more regional steps."
Tehran also believes it will encourage the West to reach a new nuclear agreement after talks have all but ended in recent months.
Maps reveal scale of reported poisoning incidents across Iran
Tel Aviv gunman wounded three after opening fire in street
US and Israel will be wary of new deal
The détente, negotiated by China, is one of the clearest signs yet that many Middle East countries are turning east after many decades of US hegemony.
It will be seen as a huge win for Chinese diplomacy in the Middle East, which won't go unnoticed in European capitals or Washington.
However, we're yet to see the fine print of the agreement.
Joe Biden's White House has had a testy relationship with the Saudi leadership ever since the president labelled the Kingdom a pariah following the killing of journalist Jamal Khashoggi.
Those relations were strained further when Saudi Arabia agreed to cut oil production, a move that was seen in Washington as helping Russia in its war against Ukraine because it raised oil prices, thus increasing revenue for Moscow.
Iran has found itself under increasing international sanctions following violent crackdowns against anti-government protests in the country - the agreement, in time, could help relieve some of the regime's economic woes.
It's unclear what the agreement will mean for Israel.
Benjamin Netanyahu has made no secret of his desire to normalise relations with Saudi Arabia. The Israeli prime minister has successfully done so with a number of other Arab states as part of The Abraham Accords.
Israel and Iran are sworn enemies, however.
Israel regularly targets Iran's nuclear development, while Tehran arms proxy groups like Hezbollah on Israel's border and supports Palestinian militants in the West Bank.