Language:
كتاب الجنائز
23  
Funerals (Al-Janaa'iz)
(22)
Chapter: To shroud one in a shirt, stitched or unstitched
(22)
باب الْكَفَنِ فِي الْقَمِيصِ الَّذِي يُكَفُّ أَوْ لاَ يُكَفُّ ، وَمَنْ كُفِّنَ بِغَيْرِ قَمِيصٍ
Sahih al-Bukhari 1269

Narrated Ibn `Umar:

When `Abdullah bin Ubai (the chief of hypocrites) died, his son came to the Prophet (ﷺ) and said, "O Allah's Messenger (ﷺ)! Please give me your shirt to shroud him in it, offer his funeral prayer and ask for Allah's forgiveness for him." So Allah's Messenger (ﷺ) (p.b.u.h) gave his shirt to him and said, "Inform me (When the funeral is ready) so that I may offer the funeral prayer." So, he informed him and when the Prophet intended to offer the funeral prayer, `Umar took hold of his hand and said, "Has Allah not forbidden you to offer the funeral prayer for the hypocrites? The Prophet (ﷺ) said, "I have been given the choice for Allah says: '(It does not avail) Whether you (O Muhammad) ask forgiveness for them (hypocrites), or do not ask for forgiveness for them. Even though you ask for their forgiveness seventy times, Allah will not forgive them. (9.80)" So the Prophet (ﷺ) offered the funeral prayer and on that the revelation came: "And never (O Muhammad) pray (funeral prayer) for any of them (i.e. hypocrites) that dies." (9. 84)

حَدَّثَنَا مُسَدَّدٌ، قَالَ حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ، عَنْ عُبَيْدِ اللَّهِ، قَالَ حَدَّثَنِي نَافِعٌ، عَنِ ابْنِ عُمَرَ ـ رضى الله عنهما ـ أَنَّ عَبْدَ، اللَّهِ بْنَ أُبَىٍّ لَمَّا تُوُفِّيَ جَاءَ ابْنُهُ إِلَى النَّبِيِّ صلى الله عليه وسلم فَقَالَ يَا رَسُولَ اللَّهِ أَعْطِنِي قَمِيصَكَ أُكَفِّنْهُ فِيهِ، وَصَلِّ عَلَيْهِ وَاسْتَغْفِرْ لَهُ، فَأَعْطَاهُ النَّبِيُّ صلى الله عليه وسلم قَمِيصَهُ فَقَالَ ‏"‏ آذِنِّي أُصَلِّي عَلَيْهِ ‏"‏‏.‏ فَآذَنَهُ، فَلَمَّا أَرَادَ أَنْ يُصَلِّيَ عَلَيْهِ جَذَبَهُ عُمَرُ ـ رضى الله عنه ـ فَقَالَ أَلَيْسَ اللَّهُ نَهَاكَ أَنْ تُصَلِّيَ عَلَى الْمُنَافِقِينَ فَقَالَ ‏"‏ أَنَا بَيْنَ خِيرَتَيْنِ قَالَ ‏{‏اسْتَغْفِرْ لَهُمْ أَوْ لاَ تَسْتَغْفِرْ لَهُمْ إِنْ تَسْتَغْفِرْ لَهُمْ سَبْعِينَ مَرَّةً فَلَنْ يَغْفِرَ اللَّهُ لَهُمْ‏}‏ ‏"‏‏.‏ فَصَلَّى عَلَيْهِ فَنَزَلَتْ ‏{‏وَلاَ تُصَلِّ عَلَى أَحَدٍ مِنْهُمْ مَاتَ أَبَدًا‏}
Reference : Sahih al-Bukhari 1269
In-book reference : Book 23, Hadith 30
USC-MSA web (English) reference : Vol. 2, Book 23, Hadith 359
  (deprecated numbering scheme)