Muslim pilgrims at the annual Hajj pilgrimage near the holy city of Mecca, Saudi Arabia.

Video. WATCH: Hundreds of thousands of Muslims brave heat at Hajj pilgrimage

With morning temperatures rising past 42 degrees Celsius, huge crowds of pilgrims walked or took buses to the vast Jamarat complex just outside the holy city of Mecca, where large pedestrian bridges lead past three wide pillars representing the devil.

With morning temperatures rising past 42 degrees Celsius, huge crowds of pilgrims walked or took buses to the vast Jamarat complex just outside the holy city of Mecca, where large pedestrian bridges lead past three wide pillars representing the devil.

Using pebbles collected the night before at a campsite known as Muzdalifa, the pilgrims stone the pillars. It's a reenactment of the story of the Prophet Ibrahim - known as Abraham in Christian and Jewish traditions - who is said to have hurled stones at Satan to resist temptation.

The ceremony was marred by tragedy on a number of occasions in the 1990s and 2000s when hundreds died in stampedes during the stoning ritual. Saudi authorities have since built an expanded network of massive pedestrian bridges and redesigned the site to make it safer for pilgrims.

This year, the biggest danger might be the heat.

Temperatures soared past 45 degrees Celsius on Tuesday, as Muslims marked the spiritual high point of the pilgrimage by spending the day praying at Mount Arafat, where there was no breeze and almost no shade.