Top Chinese diplomat Wang Yi (middle), Ali Shamkhani, the secretary of Iran's Supreme National Security Council (right), and Minister of State and national security adviser of Saudi Arabia Musaad bin Mohammed Al Aiban (right) pose for pictures during a meeting in Beijing, China on Friday.

Editor’s Note: A version of this story first appeared in CNN’s Meanwhile in the Middle East newsletter, a three-times-a-week look inside the region’s biggest stories. Sign up here.

Abu Dhabi and Jerusalem CNN  — 

Saudi Arabia and Iran have given each other just two months to prove they are serious about Friday’s surprise agreement to normalize ties.

Before ambassadors are reinstated, the two nations are likely to be discussing ways to end almost seven years of hostility, a large task given how far-reaching the implications could be.

The reconciliation happens as Iran finds itself increasingly isolated on the world stage and Saudi Arabia changes the course of its foreign policy in favor of diplomacy instead of confrontation.

With a focus on economic development, Saudi Arabia and its neighbor, the United Arab Emirates, have in recent years moved to mend fences with most of their regional adversaries.

Riyadh has walked back from a hawkish foreign policy it had adopted when Crown Prince Mohammed bin Salman entered the picture after his father King Salman took the throne in 2015. It has reconciled with Turkey, re-engaged with Syria, and supported a ceasefire in Yemen.