(1) بَابُ خَلْقِ آدَمَ صَلَوَاتُ اللَّهِ عَلَيْهِ وَذُرِّيَّتِهِ
Narrated `Abdullah:
Allah's Messenger (ﷺ), the true and truly inspired said, "(as regards your creation), every one of you is
collected in the womb of his mother for the first forty days, and then he becomes a clot for another
forty days, and then a piece of flesh for another forty days. Then Allah sends an angel to write four
items: He writes his deeds, time of his death, means of his livelihood, and whether he will be
wretched or blessed (in religion). Then the soul is breathed into his body. So a man may do deeds
characteristic of the people of the (Hell) Fire, so much so that there is only the distance of a cubit
between him and it, and then what has been written (by the angel) surpasses, and so he starts doing
deeds characteristic of the people of Paradise and enters Paradise. Similarly, a person may do deeds
characteristic of the people of Paradise, so much so that there is only the distance of a cubit between
him and it, and then what has been written (by the angel) surpasses, and he starts doing deeds of the
people of the (Hell) Fire and enters the (Hell) Fire."
Reference: Sahih al-Bukhari 3332
In-book reference: Book 60, Hadith 7
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 4, Book 55, Hadith 549