Almost 2.5 million pilgrims have taken part in a symbolic stoning of the devil in the final days of the hajj pilgrimage in Saudi Arabia, as Muslims around the world marked the start of the Eid al-Adha celebrations.

In Mina, pilgrims threw pebbles at a pillar in a symbolic casting away of evil.

Muslim pilgrims cast stones at a pillar in Mina
Muslim pilgrims cast stones at a pillar in Mina (Amr Nabil/AP)

The massive tent city is where the deadliest hajj disasters have occurred, including a 2015 stampede and crush that killed more than 2,400 people.

To mark the completion of the hajj, male pilgrims shaved their hair and women trimmed theirs on Saturday to represent a spiritual renewal and rebirth.

Muslims around the world are commemorating the end of hajj with Eid celebrations, including distributing meat to the poor.

“I came from Sudan to Mecca where I performed the pilgrimage,” Mohammed Saleh said as he performed the final rites of hajj in Mina. “We hope all pilgrims will be successful in their hajj.”

Saudi Arabia said 1.85 million pilgrims from more than 160 different countries travelled to the kingdom for the hajj this year. Another 634,000 joined from within Saudi Arabia, nearly 70% of them non-Saudi residents of the kingdom.

The hajj is one of the largest religious gatherings on earth and a massive logistical challenge for the Saudi government to oversee each year. The kingdom provides pilgrims with health care and buses for transportation, as well as meals, snacks and water along the routes of hajj.

Muslim pilgrims make their way down a rocky hill known as the Mountain of Mercy, on the Plain of Arafat, during the annual hajj pilgrimage, near the holy city of Mecca, Saudi Arabia
Muslim pilgrims make their way down a rocky hill known as the Mountain of Mercy, on the Plain of Arafat, during the annual hajj pilgrimage, near the holy city of Mecca, Saudi Arabia (Amr Nabil/AP)

Saudi media reported King Salman visited Mina on Sunday to supervise the services provided during the hajj. He included among his guests for the hajj this year 200 survivors and relatives of victims of the mosque attacks in New Zealand, where a gunman opened fire and killed 51 people in March.

While following a route the Prophet Mohammed once walked, Muslims trace the rites of hajj back to the prophets Ibrahim and Ismail, or Abraham and Ishmael as they are named in the Bible.

It is in Mina where Muslims believe Ibrahim’s faith was tested when God commanded him to sacrifice his only son Ismail. Ibrahim was prepared to submit to the command, but then God stayed his hand, sparing his son. In the Christian and Jewish version of the story, Abraham is ordered to kill his other son, Isaac.

Muslims believe the hajj offers the chance of atonement and an opportunity to erase past sins. The first two days of the hajj are spent in Mecca and other areas around it in deep prayer, contemplation and worship.