it is narrated from Imam as-Sadiq that Adam was in Sajdah for 40 days on Mt. Safa and was lamenting the separation from Divine Mercy and heaven. Archangel Gabriel came to him and inquired why he was weeping. He said, “Why should not I cry? Allah has separated me from the vicinity of His Mercy and sent me down to Earth.” Archangel Gabriel said, “O Adam! Ask forgiveness from Allah.” “How should I repent,” he asked. Allah sent for him a dome of light at the site of Ka‘bah. Its glow illuminated the mountains of Makkah as high as the sanctuary. Allah ordered Archangel Gabriel to mark the precincts of the sanctuary. On the 8th of Dhu’l-hijjah Archangel Gabriel came to Adam and told him to arise. He took him out of the sanctuary and instructed him to perform Ghusl and wear the Ihram. Then he took him to the Mina and camped there overnight. Next morning they went to the plains of ‘Arafat. On the day of ‘Arafat at the time of Dhuhr prayers Adam was told to recite the Talbiya and perform Ghusl. After he completed the prayers Archangel Gabriel told him to stand on the plains of ‘Arafat and taught him the words that he had learnt from his Lord:
Subh’aanaka Allahumma wa be hamdeka laa ilaaha illa anta. A’melto sooan wa zalamto nafsi wa’tarafto be dhanbi. Faghfirli innaka antal gafoorur rah’eem. Subhaanaka Allahumma wa be hamdeka laa ilaaha illa anta. A’melto soooan wa zalamto nafsi wa’tarafto be dhanbi. Faghfirli innaka anta khairul ghaafereen. Subhaanaka Allahumma wa be hamdeka laa ilaaha illa anta. A’melto soooan wa zalamto nafsi wa’tarafto be dhanbi. Faghfirli innaka anta attawwaaburraheem.
Adam kept standing, prayed to Allah with sincerity, and wept. At sunset, Archangel Gabriel took Adam to Mash’ar and they stayed there for the night. In the morning, Adam stood on Mountain of Mashar-il-haram and prayed to Allah with the words that were taught to him. Allah forgave his sins. Then Archangel Gabriel brought him to Mina and asked him shave his head and again brought him to Makkah. Upon reaching al-Jamarah al-Ula, the Satan came to him and said, “O Adam! Where are you going?” Archangel Gabriel told Adam to say Allahu Akbar and hit him seven times with pebbles. When Adam did this, the Satan fled. Again, he met Adam at al-Jamarah al-Thaniyah. Archangel Gabriel again told him to toss seven pebbles. Adam obeyed reciting Allahu Akbar simultaneously. Satan ran away. At al-Jamarah al-Thalithah, Satan appeared once again and Adam threw seven pebbles at him while repeating Allahu Akbar. Satan ran away. Archangel Gabriel said, “You will not see him again.” Archangel Gabriel brought Adam towards Ka‘bah and ordered him to do circumambulation seven times. Archangel Gabriel said to Adam that Allah has accepted his repentance and has made his wife halal (permissible) to him. When Adam finished the hajj he met Angels at Abtali who said, “May Allah accept your hajj. We have performed the hajj of this House 2000 years before you.”