In Tehran, the foreign ministry said Qatar's decision followed a telephone conversation on Wednesday night between Foreign Minister Mohammed Javad Zarif and his Qatari counterpart, Mohammed bin Abdulrahman Al-Thani.
The countries' foreign ministers spoke on the phone Thursday and discussed "bilateral relations" as well as a "number of issues of common concern", the statement said, adding Qatar's ambassador will return to Iran to exercise "diplomatic duties".
However, the two countries maintained commercial ties, particularly their joint operation of the world's largest gas field, called the South Pars Field by Iran and the North Field by Qatar.
The hajj has been clouded by the worst political crisis in the Gulf in decades, with Saudi Arabia leading a four-state bloc that suspended all ties with Doha on June 5 over accusations the emirate backed Islamist extremists.
Thousands of Iranian pilgrims are now undertaking the haj pilgrimage in Saudi Arabia. Qatar, obviously, categorically denies each and every one of those allegations.
US Navy's 7th Fleet commander sacked after fatal accidents in the Pacific
"Until we have exhausted any potential of recovering survivors or bodies, the search and rescue efforts will continue", he said . Although search efforts will now be mostly focused on the damaged destroyer, the task can still be a hard one.
Iranian protesters stormed the Saudi embassy in Tehran in January 2016 after a prominent Saudi Shi'ite cleric was executed, prompting Riyadh to close the embassy. It also announced plans to close its Doha embassy and recall all personnel.
"The state of Qatar expressed its aspiration to strengthen bilateral relations with the Islamic Republic of Iran in all fields", a short Foreign Ministry statement said.
They accuse Doha of meddling in the internal affairs of other countries and financing terrorism - a charge Qatar has dismissed as "baseless".
"It's gone on for far too long".
On the contrary, Saudi Arabia has been seeking to create tensions in the region to fulfill its own interests, the Iranian minister added. However, Qatar adamantly let the compliance deadline pass. Among the demands were that Qatar shutter its worldwide news organization, Al-Jazeera. Attempts by Kuwait, the USA and others have failed to make headway. There have been suggestions that the sheikh could be the start of a Qatari government-in-exile.
Qatar is a United States ally and the USA maintains a large military base there, home to some 11,000 personnel. "We hope they will choose another path".