It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "When Allah Almighty intends to create a soul, the angel appointed over the wombs submits (in the divine presence): 'O my Lord, is it male or female?' So Allah Almighty decrees His decision. Then the angel submits again: 'O my Lord, is it wretched or blessed?' And Allah Almighty issues His command. Then between his two eyes is written all that he is going to face, even the slightest hardship or stumble that will befall him."
Hadith Referenceمسند أبي يعلى الموصلي / مسند عبد الله بن عمر / 5775
Hadith Gradingمحدثین:إسناده صحيح
Hadith Takhrij«حکم الحدیث مسند ابی یعلی محققاً تنسیق حسين سليم أسد - مکتبہ شاملہ :قال حسين سليم أسد: إسناده صحيح . » «قال سعيد بن محمد السناري: صحيح» «أخرجه ابن حبان [6178] وابن أبى عاصم في "السنة" [1/ رقم 182]، والمزى في "تهذيبه" [17/ 472]، وابن وهب في "القدر" [رقم 30]، و، مسند ابویعلیٰ ترقیم الاثری: 5748»