Narrator:Anas ibn Mālik
حَدَّثَنَا سُلَيْمَانُ بْنُ حَرْبٍ، حَدَّثَنَا حَمَّادٌ، عَنْ عُبَيْدِ اللَّهِ بْنِ أَبِي بَكْرِ بْنِ أَنَسٍ، عَنْ أَنَسِ بْنِ مَالِكٍ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ "
وَكَّلَ اللَّهُ بِالرَّحِمِ مَلَكًا فَيَقُولُ أَىْ رَبِّ نُطْفَةٌ، أَىْ رَبِّ عَلَقَةٌ، أَىْ رَبِّ مُضْغَةٌ. فَإِذَا أَرَادَ اللَّهُ أَنْ يَقْضِيَ خَلْقَهَا قَالَ أَىْ رَبِّ ذَكَرٌ أَمْ أُنْثَى أَشَقِيٌّ أَمْ سَعِيدٌ فَمَا الرِّزْقُ فَمَا الأَجَلُ فَيُكْتَبُ كَذَلِكَ فِي بَطْنِ أُمِّهِ "
Anas ibn Mālik (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) said: "Allah has appointed an angel in charge of the womb, and the angel says: 'O Lord, (it is) a sperm drop! O Lord, (it is now ) a clot! O Lord, (it is now) a piece of flesh.' Then, when Allah wills to complete its creation, the angel asks: 'O Lord, (will it be) a male or female? Wretched (an evil doer) or blessed (doer of good)? How much will his provisions be? How long will he live?' All that is written while the fetus is still in his mother's womb."
Reported by Al-Bukhari (No. 6595, 318, 3333), Muslim (No. 2646) and Ahmad (No. 11714, 12042).