والصلاة على من مات من أهل القبلة سنة والمرجوم والزاني والزانية والذي يقتل نفسه وغيره من أهل القبلة والسكران وغيرهم الصلاة عليهم سنة
 « And the Funeral Prayer over the deceased Muslims (Ahlul-Qiblah) is a Sunnah : This includes the one who is stoned to death for adultery, the fornicating man and woman, the one who kills himself, and other than them from the People of Qiblah such as the drunkard and so on – praying the Funeral Prayer over them is a Sunnah. »
This is like as what has preceded : that the one who manifests Imaan and Islaam, then we pray the Funeral Prayer (Salaat Janazah) over him, and he is considered as being amongst Ahlul-Qiblah, and they are those who pray in the direction of the Ka’abah in Makkah. This is the Qiblah (direction of prayer) of the Muslims. We behave towards them based upon what is apparent, and we judge them to be Muslims. We treat them as Muslims, whether living or dead.
His saying :
« والمرجوم والزاني والزانية والذي يقتل نفسه وغيره من أهل القبلة »
« This includes the one who is stoned for adultery, the fornicating man and woman, the one who kills himself and other than them from the People of Qiblah… »
The sinful believer who does not exit Islam due to his major sin is dealt with as a Muslim. He is supplicated for, such as the one who kills himself by committing suicide, or the one stoned to death for adultery. The Prophet (صلى الله عليه وعلى آله وسلم) prayed Janazah over the one stoned to death ; he prayed over the Companion Mâ’iz (رضي الله عنه) , and over the female Companion al-Ghâmidiyah (رضي الله عنها) .
The Prophet (صلى الله عليه وعلى آله وسلم) withheld from praying over some of the people such as the one who committed suicide, and the one who stole from the war booty. This was from the aspect of discipling the people and not due to him considering them to be disbelievers, and for this reason he would grant permission to the Companions to pray over such a person, and he would not prevent them from praying over him due to the fact that such a person is a Muslim.
His saying :
« … والسكران وغيرهم الصلاة عليهم سنة »
« …the drunkard and so on – praying the Funeral Prayer over them is a Sunnah ».
The drunkard is the one who drinks intoxicants, a sinner (faasiq), and the Prescribed Punishment (al Hadd) is established upon him. However, he does not exit Islam, and if he dies the Janazah is prayed over him even if he was a consumer of intoxicants due to the fact that he was from Ahlul-Qiblah.
His saying :
« سنة »
« …is a Sunnah »
Meaning it is from the Sunnah of the Messenger (صلى الله عليه وعلى آله وسلم) which one is obligated to follow.
 Sahih Bukhari 6820
عَنْ جَابِرٍ، أَنَّ رَجُلاً، مِنْ أَسْلَمَ جَاءَ النَّبِيَّ صلى الله عليه وسلم فَاعْتَرَفَ بِالزِّنَا فَأَعْرَضَ عَنْهُ النَّبِيُّ صلى الله عليه وسلم حَتَّى شَهِدَ عَلَى نَفْسِهِ أَرْبَعَ مَرَّاتٍ. قَالَ لَهُ النَّبِيُّ صلى الله عليه وسلم “ أَبِكَ جُنُونٌ “. قَالَ لاَ. قَالَ “ آحْصَنْتَ “. قَالَ نَعَمْ. فَأَمَرَ بِهِ فَرُجِمَ بِالْمُصَلَّى، فَلَمَّا أَذْلَقَتْهُ الْحِجَارَةُ فَرَّ، فَأُدْرِكَ فَرُجِمَ حَتَّى مَاتَ، فَقَالَ النَّبِيُّ صلى الله عليه وسلم خَيْرًا وَصَلَّى عَلَيْهِ. لَمْ يَقُلْ يُونُسُ وَابْنُ جُرَيْجٍ عَنِ الزُّهْرِيِّ فَصَلَّى عَلَيْهِ.
A man from the tribe of Aslam came to the Prophet (صلى الله عليه وعلى آله وسلم) and confessed that he had committed an illegal sexual intercourse. The Prophet (صلى الله عليه وعلى آله وسلم) turned his face away from him till the man bore witness against himself four times. The Prophet (صلى الله عليه وعلى آله وسلم) said to him, “Are you mad?” He said “No.” He said, “Are you married?” He said, “Yes.” Then the Prophet (صلى الله عليه وعلى آله وسلم) ordered that he be stoned to death, and he was stoned to death at the Musalla. When the stones troubled him, he fled, but he was caught and was stoned till he died. The Prophet (صلى الله عليه وعلى آله وسلم) spoke well of him and offered his funeral prayer.
 Sahih Muslim 4206
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ بُرَيْدَةَ، عَنْ أَبِيهِ، أَنَّ مَاعِزَ بْنَ مَالِكٍ الأَسْلَمِيَّ، أَتَى رَسُولَ اللَّهِ صلى الله عليه وسلم فَقَالَ يَا رَسُولَ اللَّهِ إِنِّي قَدْ ظَلَمْتُ نَفْسِي وَزَنَيْتُ وَإِنِّي أُرِيدُ أَنْ تُطَهِّرَنِي . فَرَدَّهُ فَلَمَّا كَانَ مِنَ الْغَدِ أَتَاهُ فَقَالَ يَا رَسُولَ اللَّهِ إِنِّي قَدْ زَنَيْتُ . فَرَدَّهُ الثَّانِيَةَ فَأَرْسَلَ رَسُولُ اللَّهِ صلى الله عليه وسلم إِلَى قَوْمِهِ فَقَالَ “ أَتَعْلَمُونَ بِعَقْلِهِ بَأْسًا تُنْكِرُونَ مِنْهُ شَيْئًا “ . فَقَالُوا مَا نَعْلَمُهُ إِلاَّ وَفِيَّ الْعَقْلِ مِنْ صَالِحِينَا فِيمَا نُرَى فَأَتَاهُ الثَّالِثَةَ فَأَرْسَلَ إِلَيْهِمْ أَيْضًا فَسَأَلَ عَنْهُ فَأَخْبَرُوهُ أَنَّهُ لاَ بَأْسَ بِهِ وَلاَ بِعَقْلِهِ فَلَمَّا كَانَ الرَّابِعَةَ حَفَرَ لَهُ حُفْرَةً ثُمَّ أَمَرَ بِهِ فَرُجِمَ . قَالَ فَجَاءَتِ الْغَامِدِيَّةُ فَقَالَتْ يَا رَسُولَ اللَّهِ إِنِّي قَدْ زَنَيْتُ فَطَهِّرْنِي . وَإِنَّهُ رَدَّهَا فَلَمَّا كَانَ الْغَدُ قَالَتْ يَا رَسُولَ اللَّهِ لِمَ تَرُدُّنِي لَعَلَّكَ أَنْ تَرُدَّنِي كَمَا رَدَدْتَ مَاعِزًا فَوَاللَّهِ إِنِّي لَحُبْلَى . قَالَ “ إِمَّا لاَ فَاذْهَبِي حَتَّى تَلِدِي “ . فَلَمَّا وَلَدَتْ أَتَتْهُ بِالصَّبِيِّ فِي خِرْقَةٍ قَالَتْ هَذَا قَدْ وَلَدْتُهُ . قَالَ “ اذْهَبِي فَأَرْضِعِيهِ حَتَّى تَفْطِمِيهِ “ . فَلَمَّا فَطَمَتْهُ أَتَتْهُ بِالصَّبِيِّ فِي يَدِهِ كِسْرَةُ خُبْزٍ فَقَالَتْ هَذَا يَا نَبِيَّ اللَّهِ قَدْ فَطَمْتُهُ وَقَدْ أَكَلَ الطَّعَامَ . فَدَفَعَ الصَّبِيَّ إِلَى رَجُلٍ مِنَ الْمُسْلِمِينَ ثُمَّ أَمَرَ بِهَا فَحُفِرَ لَهَا إِلَى صَدْرِهَا وَأَمَرَ النَّاسَ فَرَجَمُوهَا فَيُقْبِلُ خَالِدُ بْنُ الْوَلِيدِ بِحَجَرٍ فَرَمَى رَأْسَهَا فَتَنَضَّحَ الدَّمُ عَلَى وَجْهِ خَالِدٍ فَسَبَّهَا فَسَمِعَ نَبِيُّ اللَّهِ صلى الله عليه وسلم سَبَّهُ إِيَّاهَا فَقَالَ “ مَهْلاً يَا خَالِدُ فَوَالَّذِي نَفْسِي بِيَدِهِ لَقَدْ تَابَتْ تَوْبَةً لَوْ تَابَهَا صَاحِبُ مَكْسٍ لَغُفِرَ لَهُ “ . ثُمَّ أَمَرَ بِهَا فَصَلَّى عَلَيْهَا وَدُفِنَتْ
‘Abdullah b. Buraida reported on the authority of his father that Ma’iz b. Malik al-Aslami came to Allah’s Messenger (صلى الله عليه وعلى آله وسلم) and said:
Allah’s Messenger, I have wronged myself; I have committed adultery and I earnestly desire that you should purify me. He turned him away. On the following day, he (Ma’iz) again came to him and said: Allah’s Messenger, I have committed adultery. Allah’s Messenger (صلى الله عليه وعلى آله وسلم) turned him away for the second time, and sent him to his people saying: Do you know if there is anything wrong with his mind. They denied of any such thing in him and said: We do not know him but as a wise good man among us, so far as we can judge. He (Ma’iz) came for the third time, and he (the Holy Prophet) sent him as he had done before. He asked about him and they informed him that there was nothing wrong with him or with his mind. When it was the fourth time, a ditch was dug for him and he (the Holy Prophet) pronounced judg- ment about him and he wis stoned. He (the narrator) said: There came to him (the Holy Prophet) a woman from Ghamid and said: Allah’s Messenger, I have committed adultery, so purify me. He (the Holy Prophet) turned her away. On the following day she said: Allah’s Messenger, Why do you turn me away? Perhaps, you turn me away as you turned away Ma’iz. By Allah, I have become pregnant. He said: Well, if you insist upon it, then go away until you give birth to (the child). When she was delivered she came with the child (wrapped) in a rag and said: Here is the child whom I have given birth to. He said: Go away and suckle him until you wean him. When she had weaned him, she came to him (the Holy Prophet) with the child who was holding a piece of bread in his hand. She said: Allah’s Apostle, here is he as I have weaned him and he eats food. He (the Holy Prophet) entrusted the child to one of the Muslims and then pronounced punishment. And she was put in a ditch up to her chest and he commanded people and they stoned her. Khalid b Walid came forward with a stone which he flung at her head and there spurted blood on the face of Khalid and so he abused her. Allah’s Apostle (صلى الله عليه وعلى آله وسلم) heard his (Khalid’s) curse that he had huried upon her. Thereupon he (the Holy Prophet) said: Khalid, be gentle. By Him in Whose Hand is my life, she has made such a repentance that even if a wrongful tax-collector were to repent, he would have been forgiven. Then giving command regarding her, he prayed over her and she was buried.