‘O people! If you are in doubt about the Resurrection—We created you from dust, then from a small drop, then from a clinging clot, then from a lump of flesh, partly developed and partly undeveloped. …We bring you out as infants, until you reach your full strength. And some of you will pass away, and some of you will be returned to the vilest age, so that he may not know, after having known….* Q 22:5.
Miscarriages can occur within the first 20 to 24 weeks of pregnancy, while stillbirths can occur onwards and during labor. Both forms of loss can occur for a variety of reasons, a vast majority of which are not preventable occurrences even in the most technologically advanced countries. As unfortunate this occurrence looks, Islam still take care of such situation; particularly how to undertake the burial rites. In other words Islam recognizes that a creation has occurred and such is entitled to proper burial starting from washing, shrouding and janazah.
According to Islamic scholarship, janāzah can be done for a stillborn baby that has moved in the womb, but not be performed prior to that, because it does not count as a dead person. A stillbirth is an inter-uterine fetal death, with a premature spontaneous or induced labour, which occurs after about 20–24 weeks. Quranic verses and Hadith indicate that the transformation of the fetus into a living person occurs at 120 days, (four months) when an angel breathes the ruh (spirit) into it the fetus. Hadith of the prophet (SAW) on the stages of fetal development in the womb.
It may also be done for a baby born alive who died before receiving azān or after. The child will be given a ghusl, wrapped in a cloth and buried. However, there are cases where performing janazah prayer is not compulsory, but it is permissible and these are on children and martyrs of Islam. In other words it is not obligatory to pray janazah on children who die before attaining puberty. For an example, the prophet (SAW) did not pray janazah on his son Ibrahim, who died at the age of eighteen months (Ahmad, Abu Dawuud).
As for still-born, the rulings differ. Janaazah may be performed for it only if the soul has been blown into it. This is evident from the narration of Ibn Mas’uud(rah); “The creation of each of you is brought together in his mother’s womb for forty days as a seed, then as a clot of blood for a similar period, then as a morsel of flesh for a similar period then Allah sends an angel who blows the soul into him..”
However, some scholars hold the opinion that the Janaazah prayer may only be performed for a miscarried fetus that was dropped alive. They based their opinion on the Hadith, “When the fetus is dropped alive, prayer may be performed for it, and it inherits.” This opinion does not take cognizance of the fact that the fetus may have lived before dying in the womb,, thus this Hadith has been verified as weak in Ahkamul-Janaa’iz page 106 of Imam Nasiruddeen Al-Albani.
Al-Mughirah ibn Shu’bah reported: The Messenger of Allah, peace and blessings be upon him, “The rider should travel behind the funeral procession, and those on foot should walk behind it, in front, to the right or to the left, near to it. The funeral prayer should be offered over the miscarried fetus, and supplications for forgiveness and mercy should be made for the parents.”Source: Sunan Abī Dāwūd 3180
Janaazah(funeral prayer) for a dead Muslim is an obligation upon a Muslim community. The prophet (SAW) performed it constantly and commanded his companions to perform it whenever it is necessary (on a dead Muslim).
May Allah guide us a right on his straight part, Amin.