for the prayer itself, not for the congregational aspect. The communal obligation is discharged by a single worshiper; some said two are required, others three, and others four. It is not discharged if only women perform it while men are present, according to the soundest view. The funeral prayer may be offered for someone who dies outside the town, and it must, in principle, precede the burial, although it remains valid afterward. The stronger opinion confines this post-burial validity to anyone who was liable for the prayer at the moment of death. Under no circumstance may the prayer be performed at the grave of the Messenger of Allah ﷺ.
Sub-issue: According to the new position, the governor has a superior right to lead the prayer to that of the legal guardian. After him come: the father, then the grandfather however remote, then the son, his son, and the brother. The sounder view prefers the full brother over the half-brother, followed by the full nephew, then the half-nephew, then the other male agnates in the order of inheritance, and finally the uterine relatives. If two are equal in rank, the elder who is upright takes precedence, as stated in the basic text. A distant free relative is given priority over a nearer slave relative. The imam stands at the head of a male and at the hips of a female.
One funeral prayer may be offered for several bodies. It is forbidden to pray over a non-Muslim; he is not to be washed, although the sound view is that a dhimmī must still be shrouded and buried. If a limb of a Muslim whose death is certain is found, the funeral prayer is performed over it.
As for a miscarried fetus: if it breathes or cries it is treated like an adult. Otherwise, if any sign of life appears—such as a convulsive movement—the predominant opinion is that the prayer is offered. If no sign appears and it has not reached four months, no prayer is performed, and the same ruling applies, according to the sound view, even if it had reached that age.
A martyr is neither washed nor prayed over. A martyr is one who dies in combat with the unbelievers because of that combat. If death occurs after the fighting ends, or in battle against rebels, he is not deemed a martyr according to the stronger view; the same applies to someone who dies during combat but not as a direct result of it. If a martyr dies in a state of major ritual impurity, the sound opinion is that he is still not washed, though impurities other than blood are removed. He is shrouded in his blood-stained clothes; if those do not fully cover him, the shroud is completed with additional cloth.