The Qadi said:
We have already discussed earlier in this book the use of actual practice as a proof, and this particular kind of argument that the Ḥanafis call “general prevalence of necessity (ʿumūm al-balwā).” We stated there that both are of the same genus.
Section Two
Those over whom the funeral prayer is performed and who has priority in leading it
The great majority of scholars agree that it is permissible to perform the funeral prayer for anyone who has uttered “There is no god but Allah.” In this regard there is a report that the Prophet—peace and blessings be upon him—said: “Pray over whoever says: ‘There is no god but Allah.’” This applies whether the deceased was guilty of major sins or belonged to the people of innovation. Mālik, however, disliked that distinguished persons should pray over innovators, and he held that the ruler or imam should not pray over someone he has executed as a ḥadd punishment.
They differed concerning one who kills himself: some held that no prayer is to be offered for him, while others permitted it.
Some scholars did not allow the funeral prayer over those guilty of grave sins, rebels, or innovators at all.
The reason for their disagreement about the prayer is as follows:
With respect to innovators, the difference turns on whether their innovation renders them unbelievers. Those who declare them disbelievers on the basis of far-fetched interpretation refuse to pray over them. Those who do not regard them as disbelievers—holding that kufr is to belie the Messenger, not to interpret his statements—say that the funeral prayer for them is permissible.
All scholars, however, concur that no prayer is to be offered for the hypocrites, despite their verbal profession of faith, because of the Almighty’s words: “And never pray over any one of them who dies, nor stand at his grave” (al-Tawbah 9:84).
As for their disagreement regarding those guilty of major sins, it can only stem from their dispute about whether sins constitute unbelief. Since this is not the doctrine of Ahl al-Sunnah, the jurists should not forbid the funeral prayer for people of major sins.
Mālik’s dislike of praying over innovators was intended as a deterrent and a punishment for them. He likewise held that the imam should not pray over one he has executed as a ḥadd, because—as he argued—the Messenger of Allah, peace and blessings be upon him, did not pray over Maʿiz, though he did not forbid others from doing so; this is reported by Abū Dāwūd.
Their disagreement over praying for a person who commits suicide is based on the ḥadīth of Jābir ibn Samurah: the Messenger of Allah—peace and blessings be upon him—refused to perform the funeral prayer for a man who had taken his own life. Whoever deemed this report authentic concluded that no prayer is to be performed for a suicide.