Saudi Arabia and Iran have agreed to resume diplomatic ties and reopen embassies, they said in a joint statement carried by the Saudi state news agency SPA.
The agreement was reached after talks in Beijing between top security officials from the two countries.
Tehran and Riyadh agreed "to resume diplomatic relations between them and re-open their embassies and missions within a period not exceeding two months", according to a statement issued by Iran, Saudi Arabia and China.
"The agreement includes their affirmation of the respect for the sovereignty of states and the non-interference in internal affairs."
They also agreed to activate a security cooperation agreement signed in 2001, as well as another earlier accord on trade, economy and investment.
Both countries thanked China, as well as Iraq and Oman for hosting earlier talks in 2021 and 2022.
The agreement was signed by Iran's top security official, Ali Shamkhani, and Saudi Arabia's national security adviser Musaed bin Mohammed Al-Aiban.
President Donald Trump signed on Monday an executive order terminating a U.S. sanctions program on Syria, allowing an end to the country's isolation from the international financial system and building on Washington's pledge to help it rebuild after a devastating civil war.
U.S. President Donald Trump plans to host Israeli Prime Minister Benjamin Netanyahu at the White House on July 7, a U.S. official said, as the U.S. president pressed for a ceasefire between Israel and Hamas in Gaza, and the return of remaining hostages.
The Israeli military acknowledged on Monday that Palestinian civilians were harmed at aid distribution centres in the Gaza Strip, saying that new instructions had been issued to Israeli forces following "lessons learned".
Palestinians in northern Gaza reported one of the worst nights of Israeli bombardment in weeks after the military issued mass evacuation orders on Monday, while Israeli officials were due in Washington for a new ceasefire push by the Trump administration.
A Ukrainian F-16 fighter pilot died in a crash while repelling a Russian air attack that involved hundreds of drones, cruise and ballistic missiles, authorities said on Sunday, as Moscow intensifies night-time air barrages in the fourth year of war.
The Federal Youth Authority has launched a programme to prepare Emirati youth for participation in UAE-led social missions around the world, including humanitarian, developmental, and cultural missions.