Climate change in Saudi Arabia could cause Muslims heading to Mecca for the Hajj pilgrimage to encounter "extreme" levels of heat, scientists have warned.

As heat and humidity in the Middle Eastern country worsens, pilgrimages that fall during the hot summer months could be the riskiest. Those include next year's, and those between 2047 to 2052 and 2079 to 2086.

Completing the Hajj pilgrimage at least once is one of the five pillars of Islam and therefore a duty for Muslims who are physically and financially able. Each year, over the course of five days, millions of Muslims take part events in Mecca in a part of the Saudi Arabian desert, which can be hot, arid and humid, thanks to the Red Sea.

Hajj involves outdoor activities such as praying at the Great Mosque of Mecca, visiting the Mount of Arafat between sunrise and sunset, and heading to Mina on the outskirts of Mecca. As the annual pilgrimage unfolds over set days according to the lunar calendar, "very high‐density crowds" result, according to the authors of the study published in the journal Geophysical Review Letters.

Muslim worshippers perform the evening prayers at the Kaaba, Islam's holiest shrine, at the Grand Mosque in Saudi Arabia's holy city of Mecca on August 25, 2017. Climate change could affect the Hajj pilgrimage to the site, according to scientist. BANDAR ALDANDANI/AFP/Getty Images

Since the 1970s, the Middle East has witnessed a spike in temperatures close to 2 C—well above the global average —and more extreme heat events thanks to climate change, the scientists said.

Extreme heat can cause exhaustion and heat stroke, which can lead a person to vomit, experience headaches and even lose consciousness.

Researchers used a computer model to predict the temperatures around Mecca until 2100. The team considered the wet-bulb temperature: a measure of "mugginess" used to calculate how quickly sweat can cool from the body at a certain temperature. It involves attaching a wet cloth to a thermometer bulb.

In 60 percent of years, the wet-bulb temperature would meet the U.S. National Weather Service's "danger" threshold when Hajj falls in the summer.

"This will happen even if substantial measures are taken to limit the impact of climate change, the study finds, and without those measures, the dangers would be even greater," the authors warned.

"Planning for countermeasures or restrictions on participation in the pilgrimage may thus be needed," they said.

Study co-author Elfatih Eltahir, professor of civil and environmental engineering at Massachusetts Institute of Technology, said in a statement: "When it comes in the summer in Saudi Arabia, conditions become harsh."