Al-Baihaqi reported from Salim bin Abi Al-J’ad that Ibn ‘Abbas said that the Prophet (peace be upon him) said: “When Abraham (peace be upon him) wanted to perform the Hajj rites, Satan blocked his way near ‘Aqabah. (Jamarah Al-Aqabah is on the left side inside Mina; the Jamarah Al-Wusta (the Middle Jamarah) is at about 11,677 meters from the first one, while Jamarah Al-Sughra (the Smallest Jamarah) is 1,564 meters further from the middle one) Abraham threw seven pebbles at him whereupon the Satan sunk into the ground. Again the Satan appeared to him near the second Jamarah. Abraham threw seven pebbles at him and he again sunk into the ground. Once again the Satan approached him near the third Jamarah, and again Abraham threw seven pebbles at him and once again the Satan sunk into the ground.” Ibn ‘Abbas added, “You throw pebbles at the Satan, and (in doing so) you follow the path of your (great) forefather Abraham (peace be upon him).” Al-Munzhri said: “This is reported by Ibn Khuzaimah in his Sahih and by Al-Hakim, and it is sound according to their criterion.”
Section : Throwing the Pebbles – Their Origin.