Most scholars agree that if the fetus was more than 120 days, meaning four months, when it was miscarried, then it is to be washed, shrouded and prayed for. It is also to be given a name.
If, on the other hand, the dead fetus is less than four months, it should not be washed and the Funeral Prayer should not be offered on it. It is to be wrapped in a piece of cloth and buried because it is a part of a human being and should be honored as a human being.
For more elaboration on the rulings of a miscarried baby, we would like to cite the following fatwa issued by Sheikh M. S. Al-Munajjid, a prominent Saudi Muslim lecturer and author, who states:
“If the fetus comes out alive and its cry is heard, then it dies, it should be washed and the Funeral Prayer offered for it; there is no scholarly dispute concerning this. It is mentioned in Al-Mughni: “The scholars unanimously agree that if the fetus is known to have lived and its cry has been heard, the Prayer should be offered for it. But if its cry is not heard, Imam Ahmad (may Allah have mercy on him) said: ‘If it has completed four months [gestation], then it should be washed and the Funeral Prayer offered for it.’ This is the view of Sa`id ibn Al-Musayyab, Ibn Sireen, and Ishaq. Ibn `Umar offered the Funeral Prayer for the son of his daughter who was born dead.” (Al-Mughni, 2/328)
It goes in Masa’il Al-Imam Ahmad, which (contains reports that) were narrated by his son `Abdullah: “I heard my father being asked about the newborn, when should the Funeral Prayer be offered for him? He said, ‘If he was miscarried after four months [gestation], the Funeral Prayer should be offered for him.” He was asked, should the Funeral Prayer be offered for him even if his cry was not heard? He said, ‘Yes.’ ” (Masa’il Al-Imam Ahmad, 2/482, mas’alah no. 673)
The author of Al-Mughni explained the reason why the Funeral Prayer may be offered for a fetus concerning whom there is doubt that it lived at all: “The Prayer offered for him is a kind of du`a’ (supplication) for him and his parents…so there is no need to be certain and sure that he lived at all, unlike matters of inheritance.”
(Al-Mughni, 2/328)
Undoubtedly this is a good understanding, because inheritance has to do with the rights of others. In contrast, a prayer has to do with the relationship between a person and his Lord.
With regard to a fetus of less than four months gestation, it should not be washed and the Funeral Prayer should not be offered for it, but it should be wrapped in a cloth and buried. That is because the soul is not breathed into it until after four moths of gestation; before that it is not a soul so the Funeral Prayer cannot be offered over it; it is like inanimate object or blood.
The evidence for that is the words of the Prophet (peace and blessings be upon him): “The miscarried fetus should be prayed over (the Funeral Prayer), and supplication for forgiveness and mercy for his parents should be offered.” (Narrated by Abu Dawud; classed as sahih by Sheikh Al-Albani in Sahih Al-Jami`, 3525).
In the case of a miscarried fetus whose sex cannot be determined, it should be given a name which is suitable for both males and females, such as Salamah, Qutadah, Sa`adah, Hind, `Utbah or Hibbatu-Allah.”