Sahih Bukhari – Hadith No : 1358

Narrated Ibn Shihab: The funeral prayer should be offered for every child even if he were the son of a prostitute as he was born with a true faith of Islam (i.e. to worship none but Allah Alone). If his parents are Muslims, particularly the father, even if his mother were a non-Muslim, and if he after the delivery cries (even once) before his death (i.e. born alive) then the funeral prayer must be offered. And if the child does not cry after his delivery (i.e. born dead) then his funeral prayer should not be offered, and he will be considered as a miscarriage. Abu Huraira, narrated that the Prophet said, “Every child is born with a true faith (i.e. to worship none but Allah Alone) but his parents convert him to Judaism or to Christianity or to Magainism, as an animal delivers a perfect baby animal. Do you find it mutilated?” Then Abu Huraira recited the holy verses: ‘The pure Allah’s Islamic nature (true faith i.e. to worship none but Allah Alone), with which He has created human beings.’ ” (30.30).

Hadith In Arabic Text :

حدثنا أبو اليمان، أخبرنا شعيب، قال ابن شهاب يصلى على كل مولود متوفى وإن كان لغية، من أجل أنه ولد على فطرة الإسلام، يدعي أبواه الإسلام أو أبوه خاصة، وإن كانت أمه على غير الإسلام، إذا استهل صارخا صلي عليه، ولا يصلى على من لا يستهل من أجل أنه سقط، فإن أبا هريرة رضى الله عنه كان يحدث قال النبي صلى الله عليه وسلم ‏”‏ ما من مولود إلا يولد على الفطرة، فأبواه يهودانه أو ينصرانه أو يمجسانه، كما تنتج البهيمة بهيمة جمعاء هل تحسون فيها من جدعاء ‏”‏‏.‏ ثم يقول أبو هريرة رضى الله عنه – ‏{‏فطرة الله التي فطر الناس عليها‏}‏ الآية‏.‏

Chapter : Funerals (Al-Janaa’iz) – كتاب الجنائز