TEHRAN - Saudi Arabia has granted a visa to an Iranian diplomat to work in a consular office in Jeddah, state media reported Sunday, in a rare sign of a thaw between the rival powers.

Foreign ministry official Mohammad Alibak has been permitted to serve as head of Iran’s Interests Section in the consulate, state news agency IRNA reported.

There was no immediate confirmation from Riyadh.

Saudi Arabia and Iran have for decades stood on opposing sides of conflicts in the Middle East including the Syrian civil war. The two countries severed diplomatic relations in early 2016 after Riyadh’s embassy in Tehran was attacked by militants in response to the execution of a top Shia cleric in Saudi Arabia.

“An informed diplomatic source said Sunday that Saudi Arabia had agreed to grant a visa to the head ... of Iran’s interests section,” IRNA reported. “Observers saw this ... as a positive diplomatic step in Tehran-Riyadh relations.”  The office is expected to be set up within the Swiss diplomatic mission in Saudi Arabia, based on an agreement signed in 2017.

Both countries agreed to Switzerland’s offer of its traditional policy of good offices and to act as a diplomatic channel between the two countries.

Saudi Arabia welcomed President Donald Trump’s decision in May to withdraw the United States from an international nuclear agreement with Iran and to reimpose economic sanctions on Tehran.

In an interview published on the Iranian Foreign Ministry’s website, the ministry spokesman said there had been a “breakthrough” in relations between the two regional rivals.

“Up until two weeks ago, no visa had been issued for the names that we had submitted a long time ago,” spokesman Bahram Qasemi said.

“But within the last week or two, there has been a breakthrough and I think there are indications that the office for the protection of interests will be opened,” he added.

Tension between the two countries have surged in recent years, with Saudi Arabia and Iran supporting opposite sides in wars in Syria and Yemen and rival political parties in Iraq and Lebanon.