Sahih al-Bukhari 1358
Abul Yaman narrated to us, (he said:) Shu'aib told us. Ibn Shihab used to say: The funeral prayer is to be prayed for every child that dies, even if it is born of fornication, because it is born upon the nature of Islam, whether its parents profess Islam or only its father is (upon Islam), even if its mother is not upon Islam. When it cries at the time of birth (and then dies), the funeral prayer is to be prayed for it, and for one that does not cry, the prayer is not to be prayed, because it is an incomplete child that has miscarried. For Hazrat Abu Hurairah (ra) used to relate that the Prophet (saw) said: “There is no child that is not born upon the natural disposition (Fitrah). Its parents make it a Jew, a Christian or a Magian, just as animals give birth to sound, whole animals. Have you found any among them with its ears cut off?” After this Hazrat Abu Hurairah (ra) would recite this verse: “the nature made by Allah— the nature in which He has created mankind” (Qur’an 30:31).
AI-translated by Islam-Today