BEIRUT, Aug 23 (Reuters) - Iran and Saudi Arabia will exchange diplomatic visits soon, Tehran said on Wednesday, indicating a possible thaw in relations between the regional rivals since they severed diplomatic ties last year.

Iranian Foreign Minister Mohammad Javad Zarif told the Iranian Students' News Agency (ISNA) that the visits could take place after the haj pilgrimage ends in the first week of September.

"The visas have been issued for both sides to make this trip," Zarif said, according to ISNA. "We are waiting for the final steps to be completed so diplomats from the two countries can inspect their embassies and consulates."

Relations between Iran and Saudi Arabia are at their worst in years, with each accusing the other of subverting regional security and supporting opposite sides in conflicts in Syria, Iraq and Yemen.

Iranian protesters stormed the Saudi embassy in Tehran in Jan. 2016 after a prominent Saudi Shi'ite cleric was executed, prompting Riyadh to close the embassy.

Saudi Arabia and several other Arab governments have severed ties with Qatar, citing its support of Iran as one of the main reasons.

Iran has blamed Saudi Arabia for being behind deadly twin attacks on June 7 in Tehran claimed by Islamic State. At least 18 people were killed and more than 40 wounded in the attacks, in which Riyadh has denied any involvement.

Thousands of Iranian pilgrims are currently undertaking the haj pilgrimage in Saudi Arabia.

(Reporting By Babak Dehghanpisheh; Editing by Robin Pomeroy) ((+44 207 542 4441))