Mina, Saudi Arabia - Nearly three million Muslim pilgrims were performing the final rituals of the hajj on Tuesday as the world's largest annual gathering neared its close without major incident.
The most dangerous rite of the annual hajj proceeded peacefully as pilgrims rushed to throw 21 stones at pillars that symbolise the devil in the village of Mina, the last rite of the annual pilgrimage.
In previous years, hundreds of people have been trampled to death in stampedes triggered by crowds trying to get close to the pillars to take their vengeance on the symbol of the devil.
To complete the ritual, pilgrims must stone the three pillars said to symbolise the devil, also referred to as Ibleess by Muslims. The largest of the pillars is Jamrat al-Aqaba, at 30 metres (100 feet).
The ritual is an emulation of Ibrahim's stoning of the devil at the three spots where he is said to have appeared trying to dissuade the biblical patriarch from obeying God's order to sacrifice his son, Ishmael.
Pilgrims then make their way to Mecca's Great Mosque for a "farewell visit" to the Kaaba, a cube-shaped structure into which is set the Black Stone, Islam's most sacred relic.
Pilgrims who are in a hurry will leave Tuesday, after they finish their stoning rituals and the farewell circumambulation of the Kaaba. Others stay for a further day.
Saudi authorities have installed a multi-level walkway through the stone-throwing site in a bid to avoid the trampling that caused the deaths of 364 people in 2006, 251 in 2004 and 1,426 in 1990.
So far, no major incidents have been reported among the pilgrims, which the Saudi statistics office said numbered 2.93 million this year. The figure includes 1.83 million foreigners.
Oil-rich Saudi Arabia has invested billions of dollars over the years to avoid the deadly stampedes that have marred the hajj in the past.
The Chinese-built Mashair Railway, also known as the Mecca Metro, is operating for the first time this year at its full capacity of 72,000 people per hour to ease congestion.
The two-track light railway connects the three holy sites of Mina, Muzdalifah and Mount Arafat.
For the first time this year, the hajj is being streamed live on video-sharing website YouTube in cooperation with the Saudi government.
The stream can be seen at youtube.com/hajjlive.
The ministry of religious affairs sends 3.25 million text messages each day to the mobile phones of pilgrims to inform them of correct procedures for the hajj rites so as to "prevent that which is harmful," ministry official Sheikh Talal al-Uqail told the official SPA news agency.
The hajj is one of the five pillars of Islam and must be performed at least once in a lifetime by all those who are able to.
Poorer pilgrims bring goods from their home countries to sell in the kingdom to cover the costs of their trip.
"We use the money we get from selling goods to finance the hajj journey... as many people cannot afford the high costs of the pilgrimage," Yusef Payef, a pilgrim from Russia's restive Caucasus region of Dagestan, told AFP.
Other pilgrims, in Mecca and surrounding villages that come to life during the five days of the annual hajj, make sure they take home souvenirs and presents from their spiritual journey.
"I'm looking for a present for my family in Jakarta," said Indonesian pilgrim Mohammed Islam, 56. "A present from Mecca is special as it reminds you of the purest spot on earth."
Prayer beads, Kaaba models, dates and holy Zamzam water from a spring inside Mecca's Grand Mosque complex are popular gifts for pilgrims to take home.