DUBAI, United Arab Emirates (AP) — Saudi Arabia on Thursday closed off the holiest sites in Islam to foreign pilgrims over the coronavirus, disrupting travel for thousands of Muslims already headed to the kingdom and potentially affecting plans later this year for millions more ahead of the fasting month of Ramadan and the annual hajj pilgrimage.

The unprecedented move, which wasn't taken even during the 1918 flu epidemic that killed tens of millions worldwide, showed the growing worry about the virus across the Middle East, which has more than 360 confirmed cases.

The region's hardest-hit nation is Iran, which is Saudi Arabia's biggest nearby rival, with the death toll reaching at least 26, the largest behind only China, where the epidemic began.

The number of infections in Iran has spiked by over 100 to at least 254, but a World Health Organization official said he believes that figure is “a substantial underestimate of the true number.”

Those Iranians who have fallen ill include Vice President Masoumeh Ebtekar, better known as “Sister Mary,” the English-speaking spokeswoman for the students who seized the U.S. Embassy in Tehran in 1979 and sparked the 444-day hostage crisis, state media reported.

Saudi Arabia barred pilgrims from Mecca, home to the cube-shaped Kaaba that the world's 1.8 billion Muslims pray toward five times a day, and also the holy city of Medina. Authorities also suspended entry to travelers holding tourist visas from nations affected by the virus.

“We expect that this will give Saudi Arabia a chance to really strengthen their own disease control measures for the moment,” said Rick Brennan, the WHO's emergency director for the Eastern Mediterranean.

The kingdom's Al Saud ruling family stakes its legitimacy in overseeing and protecting the sites, and it appeared to reflect worries about pilgrims spreading the virus.

The outbreak's epicenter in Iran is the holy city of Qom, where the faithful are drawn to a famous Shiite shrine that has stayed open despite calls by the civilian government for it and other sites to be closed. Authorities have canceled Friday prayers in Qom, Tehran and other cities.

There have been no confirmed cases of the virus in Saudi Arabia, although infected Saudis are under care in neighboring Bahrain.

“We ask God Almighty to spare all humanity from all harm," the Saudi Foreign Ministry said in a statement announcing the decision.

By leaving the suspension of travel to the holy sites open-ended, Saudi Arabia has raised the possibility of disruption for Ramadan and the hajj.

The news shocked the world's Muslims, many of whom save their entire lives for a chance to see the Kaaba and walk along the path of the Prophet Muhammad and visit his tomb in Medina.

Some of them who are already headed to Saudi Arabia heard about the ban as they reached airports in Pakistan, Indonesia and Turkey.

Authorities at Cairo's international airport said the decision created “intense confusion” and “extreme anger” among thousands of passengers waiting for flights. Reinforcements were called to control the crowd as the news broke, according to security officials who spoke on condition of anonymity because they weren't allowed to talk to reporters.

"This is a long-awaited journey for me and my four members of family," said Achmad Warsito, a disappointed pilgrim in Indonesia. “No words can describe how I feel today.”

Disease outbreaks have always been a concern surrounding the hajj, which is required of all able-bodied Muslims once in their lives. Pilgrims fought off a malaria outbreak in 632, cholera in 1821 killed an estimated 20,000, and another cholera outbreak in 1865 killed 15,000 before spreading worldwide.

More recently, Saudi Arabia faced danger from a different coronavirus, one that causes the Middle East respiratory syndrome, or MERS. The kingdom increased its public health measures during the hajj in 2012 and 2013, urging the sick and the elderly not to take part.

In recent years, Saudi officials also instituted bans on pilgrims coming from countries affected by the Ebola virus.

Since the new coronavirus emerged in December, it has sickened 82,000 people globally and caused more than 2,800 deaths from the illness that has been dubbed COVID-19.

While millions attend the hajj, which this year is set for late July into early August, millions more visit the kingdom's holy sites year round. Those other pilgrimages are referred to as the umrah, which drew 7.5 million people in 2019 alone. One of the biggest times for the umrah is the Muslim fasting month of Ramadan, which begins at the end of April. The exact dates for the hajj and Ramadan always depend on the sighting of the moon due to the lunar calendar.

Pilgrims spend upward of 10 days at holy sites, mingling in tight quarters. Many are older, have pre-existing diseases and come from countries “with suboptimal disease surveillance,” according to a letter Thursday in The Lancet medical journal. Respiratory infections already are the most-common illnesses.

“We do not need to wait for the first case to emerge in Saudi Arabia’s holy sites," the letter said. "The time for preparedness is now.”

Dr. Ziad A Memish, a Saudi professor who studies infectious diseases and co-signed the letter, welcomed the kingdom's decision.

“This is a very tough decision,” he told The Associated Press. “But with the rapid spread of COVID-19 and a lack of good diagnostics, preventative vaccines and therapeutics, this is the best decision that could be taken at such difficult times.”

Kristian Ulrichsen, a research fellow at the James A. Baker III Institute for Public Policy at Rice University, called the Saudi decision “unprecedented.”

"Given the worldwide spread of the virus and the global nature of the umrah, it makes sense from a public health and safety point of view,” he said, “especially since the Iranian example illustrates how a religious crossroads can so quickly amplify the spread and reach of the virus.”

Dalia Samhouri of the WHO’s regional health emergencies department told AP that the Middle East “is plagued by emergencies,” adding that two-thirds of its 22 countries are “directly or indirectly facing complex emergencies.”

She said weak health systems increase the vulnerabilities of populations and the risk of disease spread so that they “may not have the capacity to early detect and rapidly respond to the COVID-19."

Brennan, the WHO regional director, said “the biggest area of concern” was Iran.

“We believe the figure 250 is a substantial underestimate of the true number,” he said. "And that’s because our disease surveillance now, our documentation, hasn’t really caught up with the disease yet. But we expect in the coming days that the numbers will increase substantially.”

Iran's Health Ministry spokesman Kianoush Jahanpour seemed to address that, saying new labs in Iran were conducting tests and the number of confirmed cases could continue to rise.

Supreme Leader Ayatollah Ali Khamenei praised medical workers, calling their efforts “very invaluable.”

The virus has struck the official in charge of Iran's response, as well as at least two lawmakers.

The state-run IRNA news agency reported that Ebtekar, the Iranian vice president and hostage-takers' spokeswoman, had been infected and had quarantined herself at home. She had attended a Cabinet meeting Wednesday with President Hassan Rouhani and other top officials and appeared pale in video on state media.

During the 1979 hostage crisis, Ebtekar threatened to “destroy” the Americans if a military raid tried to rescue them.

IRNA separately reported 81-year-old cleric Hadi Khosroshahi, Iran's former ambassador to the Vatican, died of the coronavirus infection at a Tehran hospital after falling ill in Qom. ___

Associated Press writers Nasser Karimi in Tehran, Iran; Munir Ahmed in Islamabad; Isabel DeBre and Maggie Michael in Cairo; Niniek Karmini in Jakarta, Indonesia; Andrew Wilks in Ankara, Turkey; and Qassim Abdul-Zahra in Baghdad contributed.