Stoning of the Devil or stoning of the jamarat (Arabic: ramy al-jamarāt) is part of the annual Islamic Hajj pilgrimage to the holy city of Mecca in Saudi Arabia. Muslim pilgrims fling pebbles at three walls called jamarat in the city of Mina just east of Mecca. It is one of a series of ritual acts that must be performed in the Hajj.
Until 2004 the three jamarat (singular: jamrah) were tall pillars. After the 2004 Hajj, Saudi authorities replaced the pillars with 26-meter-(85 ft) long walls  for safety; many people were accidentally throwing pebbles at people on the other side. The jamarat are named (starting from the east) the first or smallest jamrah (Arabic: al-jamrah al-ula or al-jamrah as-sughra), the middle jamrah (al-jamrah al-wusta), and the largest jamrah or jamrah of Aqaba (al-jamrah al-kubra or jamrat al-`Aqabah). Before 2004 the distance between the small and middle jamrah was 150 meters; between the middle and large jamrah it was 225 meters. To allow easier access to the jamarat a single tiered pedestrian bridge called the Jamarat Bridge was built around them so pilgrims could throw stones from either the ground level or from the bridge.
On the 10th day of Dhu al-Hijjah (Eid ul-Adha), pilgrims must hit the large jamrah only with seven pebbles. On each of the following two days they must hit each of the three walls with seven pebbles, going in order from east to west. Thus at least 49 pebbles are needed for the ritual, more if some throws miss. Some pilgrims stay at Mina for an additional day; in this case they must again stone each wall seven times.
The pebbles used in the stoning are traditionally gathered at Muzdalifah, a plain southeast of Mina , on the night before the first throwing, but can also be collected at Mina.
The ritual re-enacts Abraham's pilgrimage to Mecca as explained by the Muslim historian al-Azraqi:
All three jamarat represent the devil: the first and largest represents his temptation of Abraham against sacrificing Ishmael, the second represents the temptation of Abraham's wife Hagar to induce her to stop him, and the third represents his temptation of Ishmael to avoid being sacrificed. He was rebuked each time, and the throwing of the stones symbolizes those rebukes.
The stoning of the jamarat also represents the repudiation of man's self (literally the "internal despot", al-Nafs al-Amarah) and the act of casting aside one's low desires and wishes. As one Islamic theologian puts it,
It is not clear from when all Pilgrims started to do this task because there is no duty or activity mentioned in Quran by God. God clearly mentions in Quran how to perform the Hajj but some ancient religious leaders established this event and many activities have been performing by the pilgrims from ancient time. Stoning is not part of religious task but all pilgrims perform it.
The stoning of the devil ritual is the most dangerous part of the pilgrimage because sudden crowd movements on or near the Jamarat Bridge can cause people to be crushed. On several occasions hundreds of participants have suffocated or been trampled to death in stampedes.
The bridge has been expanded in recent years to accommodate the ever-growing number of pilgrims who perform the Hajj every year, but because of the sheer size of the crowds the ritual is nearly impossible to control. An important step in managing crowds is the recent replacement of the jamarat pillars by walls to ease and speed up the stoning.
Crowd conditions are especially difficult during the final day of Hajj, which is the day pilgrims leave the valley of Mina and return to Mecca for the farewell Tawaf (the final circumambulation of the Kaaba). According to hadith, Muhammad's last stoning was performed just after the noon prayer. Many scholars feel that the ritual can be done any time between noon and sunset on this day; however, many Muslims are taught that it should be done immediately after the noon prayer. This leads to people camping out until noon and rushing out then to do the stoning. Because this is also the day pilgrims prepare to leave Mina, many also take their luggage with them to the jamarat, adding to the clutter of the already crowded area.
These two factors are felt to be most responsible for the most recent tragedy during the Hajj of 2006, in which a stampede killed at least 346 pilgrims and injured at least 289 more. This was despite several attempts by the authorities to inform pilgrims about the permissibility of staggering their visits to the jamarat as well as instructing them to leave their luggage at their tents. Adding to the confusion involved in the tragedy is the lack of co-operation on the part of pilgrims who do not leave the jamarat area by the proper route, and therefore interfere with the movement of others who are arriving.