The Prophet ﷺ said, "The funeral prayer is performed over a miscarried child, and supplication is made for its parents asking for forgiveness and mercy."
قال النبي ﷺ: السقط يصلى عليه، ويدعى لوالديه بالمغفرة والرحمة.
Narrated by Abu Dawud (3180), Tirmidhi (1031), Nasai (1943), and Ibn Majah (1481), all through various routes from Ziyad bin Jubayr, from his father, from Mughira bin Shuba, who mentioned it in a long hadith. See "What Has Been Said About Riding Behind the Funeral Procession." Its chain of transmission is sahih. Hakim said, "Sahih according to the criteria of Bukhari."The stillborn child for whom the funeral prayer is performed is one who has completed four months in the womb, based on the hadith of Ibn Masud, who said, the Messenger of Allah ﷺ told us, and he is the truthful one whose truthfulness is confirmed, "The creation of each of you is gathered in his mother's womb for forty days and forty nights, then he becomes a clot of blood for a similar period, then he becomes a lump of flesh for a similar period, then the angel is sent to him and is commanded with four matters, so his provision, his lifespan, his deeds, and whether he will be among the wretched or the blessed are recorded, then the soul is breathed into him." Agreed upon by Bukhari (7454) and Muslim (2643), which has already been discussed in the Book of Faith.In accordance with this, Imam Ahmad held that the stillborn child is washed and the funeral prayer is performed over him. According to Shafii, he is washed, and there are two views regarding the funeral prayer over him. Abu Hanifa and Malik said he is neither washed nor prayed over unless he cried out at birth.In the same vein is what was narrated from Abu Hurairah as a raised report, "Pray over your children, for they are among your forerunners." Narrated by Ibn Majah (1509), through the route of Bakhtari bin Ubayd, from his father, from Abu Hurairah, who mentioned it. Bakhtari is daif and discarded. Abu Hatim said, "Weak in hadith." Ibn Hibban said, "It is not permissible to rely on him when he narrates alone." His father, Ubayd, who is Ubayd bin Salman Tai, is "unknown," as stated by Abu Hatim and Daraqutni.As for what was narrated from Jabir, who said, the Messenger of Allah ﷺ said, "The child is not prayed over, and does not inherit or get inherited from, until he cries out at birth," this is daif. Narrated by Tirmidhi (1032), Nasai in "Kubra" as mentioned in "Tuhfa," Ibn Majah (1508), Ibn Hibban (6032), and Hakim (4/348–349), all from the hadith of Abu Zubayr, from Jabir, who mentioned it.Abu Zubayr Makki is a mudallis (one who conceals defects in transmission), and he narrated it using the ambiguous form "an." Moreover, people have differed considerably regarding this hadith, as Tirmidhi stated. Some narrated it from Abu Zubayr as a raised report, while others narrated it from Abu Zubayr as a stopped report, and this latter version seems to be more correct.Ibn Hajar said in "Talkhis" (2/113), "Nasai affirmed this view. Daraqutni said in 'Ilal,' 'Its raised form is not valid.' It has also been narrated from Sharik, from Abu Zubayr, as a raised report, but this is not valid either." He then listed the routes from Abu Zubayr and weakened them. He then attributed all these defects to the tadlis (concealed transmission) of Abu Zubayr, even though it is preserved from Sufyan Thawri, from Abu Zubayr, from Jabir, as narrated by Hakim, who declared it sahih according to the criteria of the two sheikhs (Bukhari and Muslim). Ibn Hajar said, "But he was mistaken, because Abu Zubayr does not meet Bukhari's criteria, and he used the ambiguous form 'an.'" End of quote.In the same vein is the hadith of Ali and Ibn Abbas, which Zaylai mentioned in "Nasb Raya" (2/277) and Ibn Hajar mentioned in "Talkhis," and we have explained their weakness.In conclusion, the condition of crying out at birth as a requirement for the funeral prayer over the stillborn child has not been established.