Qatar says its ambassador will return to Tehran more than 20 months after he was recalled in protest over the ransacking of Saudi Arabia's missions by protesters.

The decision defies demands by Saudi Arabia and several Arab allies that Doha sever remaining ties with Tehran.

Qatar's Foreign Ministry announced on August 24 that its ambassador would "return to resume his diplomatic duties," without specifying an exact date for the ambassador's return or providing his name.

A statement said Doha was seeking to "strengthen bilateral relations with the Islamic Republic of Iran in all fields," adding that Qatari Foreign Minister Sheikh Muhammad bin Abdulrahman al-Thani had discussed the matter in a telephone call with his Iranian counterpart, Mohammad Javad Zarif.

Later in the day, Iranian Foreign Ministry spokesman Bahram Qasemi said that during the conversation late on August 23, the Qatari side “expressed their desire to send their ambassador back to Tehran and we welcomed this decision."

"The development of relations with our neighbors is an absolute priority" for Tehran, Qasemi added.

Qatar recalled its ambassador to Iran in January last year after Saudi Arabia cut ties with the Islamic republic, accusing Tehran of failing to protect its embassy in the capital and consulate in Mashhad against protesters who had ransacked them.

The protests followed Saudi Arabia's execution of Sheikh Nimr al-Nimr, a prominent Shi'ite cleric in the kingdom who had rallied antigovernment protests.

Riyadh said the execution was justified as part of its "war on terrorism."

Qatar's decision to restore ties with Iran comes amid a diplomatic dispute between Qatar and other Arab countries, including Saudi Arabia, the United Arab Emirates, Egypt, and Bahrain.

The four countries cut diplomatic ties and transportation links with Qatar over the Persian Gulf state's alleged funding of Islamic extremists -- a charge Doha denies -- and its ties to Tehran.

Iran has shown its support to Qatar, in particular by sending food shipments to Qatar and by allowing Qatar's national carrier to use its airspace.

Also on August 24, Zarif, the Iranian foreign minister, was quoted as saying that Iran and Saudi Arabia will exchange diplomatic visits soon.

He told the semiofficial ISNA news agency that the visit could take place after the hajj pilgrimage in Saudi Arabia ends in the first week of September.

"Visas have been delivered for the two sides," Zarif said. "The final steps need to be completed so our diplomats can go inspect our embassy and consulate in Saudi Arabia and for Saudi diplomats to come inspect their embassy and consulate."

An agreement between Tehran and Riyadh earlier this year will allow Iranian citizens to take part in this year's hajj.

Iranians were largely absent from the pilgrimage last year following a 2015 crowd stampede that killed hundreds of Iranian worshippers.

Meanwhile, the Russian Foreign Ministry said Foreign Minister Sergei Lavrov would visit Qatar, Kuwait, and the United Arab Emirates next week for talks that are set to include the crisis in the Persian Gulf.

"Russia has been consistently calling on the interested states to abandon confrontation rhetoric, discuss the accrued points at issue at the negotiating table, and reach compromise solutions," ministry spokeswoman Maria Zakharova said.