An Iranian Shiite Muslim pilgrim prays in front of the Kaaba, inside Mecca's Grand Mosque, Islam's holiest shrine in Saudi Arabia on June 5, 2008 . Iran has failed to reach agreement with Saudi Arabia on arrangements for its pilgrims to join the annual hajj in September following a severing of ties, its culture minister said. (Hassan Ammar/AFP/Getty Images)

Iran announced Thursday that it will suspend its participation in the annual hajj, the pilgrimage to Saudi Arabia that is a religious duty for all Muslims, in the latest sign of deteriorating relations between the two Middle Eastern heavyweights.

The decision comes amid Iran’s increasingly strident criticism of Saudi Arabia’s management of the pilgrimage in the wake of a deadly stampede in September. The disaster resulted in the deaths of at least 2,000 pilgrims, including 464 Iranians, according to an Associated Press count based on official reports.

Ali Jannati, Iran’s minister of culture and Islamic guidance, told the state news agency that negotiations with Saudi Arabia over granting visas and transportation for the hajj had broken down, making it impossible for Iranians to visit Mecca this year.

“We did whatever we could, but it was the Saudis who sabotaged,” the Islamic Republic News Agency quoted Jannati as saying. The news agency described the cancellation as “tentatively confirmed.”

Iran and Saudi Arabia, which follow Shiite and Sunni strands of Islam, respectively, have long been rivals in the region, but competition has intensified in recent years.

The two countries back opposite sides in the conflicts raging in Yemen and Syria, and their governments have accused each other of supporting terrorism and undermining stability in their countries.

Iran last suspended its participation in the hajj in 1988 and 1989 after it accused Saudi forces of opening fire on its pilgrims, resulting in 400 deaths.

Iran strongly criticized Saudi handling of the pilgrimage last year after the stampede, but it was the execution of a Shiite Saudi cleric in January that led to a severing of ties.

The execution of Sheik Nimr Baqr al-Nimr, who had long served as the voice of Saudi Arabia’s Shiite minority, prompted protests in Iran, and a crowd ransacked the Saudi Embassy in Tehran.

Saudi Arabia broke off ties and closed its diplomatic missions in response. That became an issue when it came to granting Saudi visas to pilgrims hoping to attend the next hajj, set for September.

According to Jannati, four months of negotiations over how Iranians could participate in the hajj finally broke down when the Saudis insisted that the pilgrims would have to go to third countries to receive their visas.

“It’s fair to say that over the last two years in particular we have seen a real deterioration in the relations between both countries,” said Mehrzad Boroujerdi, a politics researcher at Syracuse University in New York.

With 2 million Muslims from around the world coming together, he said, the hajj had the potential to be a unifying moment.

“Hajj represents an opportunity where you could try to mend fences and deal with an issue that is not necessarily political, and, yet, even that issue has become a bit problematic,” he said.

Boroujerdi added that there has been a social media campaign in Iran calling for a boycott of the pilgrimage and encouraging ­Iranians to spend their money on local charitable causes rather than in Saudi Arabia.

Saudi Arabia, which has yet to comment on the Iranian decision, has portrayed Iran as the main threat to the stability of the region.

Riyadh feels threatened by the nuclear deal reached between Iran and world powers last year. The accord led to the lifting of economic sanctions against Iran in exchange for restrictions on its nuclear program.