AP – DUBAI, United Arab Emirates Following years of tense relations between the two nations, including a devastating attack on the core of the kingdom’s oil production that was claimed to Tehran, Iran and Saudi Arabia on Friday decided to reestablish diplomatic relations and reopen embassies.

The agreement was reached this week in Beijing during the National People’s Congress, which is a ceremonial gathering. Gulf governments believe that the United States is gradually leaving the larger Middle East, and the arrangement constitutes a significant diplomatic success for China. It also occurs as officials work to put an end to the protracted crisis in Yemen, which has been raging for several years and is heavily influenced by both Iran and Saudi Arabia.

The two nations announced the accord in a joint statement with China, who reportedly mediated the deal.Iranian official media published pictures and a video that it claimed was shot during the meeting in China. The Supreme National Security Council of Iran’s secretary, Ali Shamkhani, was pictured alongside Wang Yi, a Chinese official, and a Saudi official.

The foreign ministries of the two countries will meet to arrange for the ambassadorial swap after the decision is put into effect, according to Iranian official media. It was also mentioned that the discussions lasted for four days.

The Associated Press sent a comment request, but Saudi Arabian officials did not answer right away. Saudi official media started publishing the identical remark shortly after the Iranian announcement.

Iran and Saudi Arabia have been at odds a lot. In the years since, tensions have risen dramatically across the Middle East since the U.S. unilaterally withdrew from Iran’s nuclear deal with world powers in 2018. Iran has been blamed for a series of attacks in the time since, including one that targeted 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 have blamed the attack on Tehran. Iran long has denied launching the attack. It has also denied carrying out other assaults later attributed to the Islamic Republic.

The Houthis seized Yemen’s capital, Sanaa, in September 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 March 2015. Years of inconclusive fighting has created a humanitarian disaster and pushed the Arab world’s poorest nation to the brink of famine.

A six-month cease-fire in Yemen’s war, the longest of the conflict, expired in October despite diplomatic efforts to renew it. That led to fears the war could again escalate. More than 150,000 people have been killed in Yemen during the fighting, including over 14,500 civilians.