Language:
كتاب الكفالة
39  
Kafalah
(3)
Chapter: He who undertakes to repay the debts of a dead person
(3)
باب مَنْ تَكَفَّلَ عَنْ مَيِّتٍ، دَيْنًا فَلَيْسَ لَهُ أَنْ يَرْجِعَ
Sahih al-Bukhari 2295

Narrated Salama bin Al-Akwa`:

A dead person was brought to the Prophet (ﷺ) so that he might lead the funeral prayer for him. He asked, "Is he in debt?" When the people replied in the negative, he led the funeral prayer. Another dead person was brought and he asked, "Is he in debt?" They said, "Yes." He (refused to lead the prayer and) said, "Lead the prayer of your friend." Abu Qatada said, "O Allah's Messenger (ﷺ)! I undertake to pay his debt." Allah's Messenger (ﷺ) then led his funeral prayer.

حَدَّثَنَا أَبُو عَاصِمٍ، عَنْ يَزِيدَ بْنِ أَبِي عُبَيْدٍ، عَنْ سَلَمَةَ بْنِ الأَكْوَعِ ـ رضى الله عنه ـ أَنَّ النَّبِيَّ صلى الله عليه وسلم أُتِيَ بِجَنَازَةٍ، لِيُصَلِّيَ عَلَيْهَا، فَقَالَ ‏"‏ هَلْ عَلَيْهِ مِنْ دَيْنٍ ‏"‏‏.‏ قَالُوا لاَ‏.‏ فَصَلَّى عَلَيْهِ، ثُمَّ أُتِيَ بِجَنَازَةٍ أُخْرَى، فَقَالَ ‏"‏ هَلْ عَلَيْهِ مَنْ دَيْنٍ ‏"‏‏.‏ قَالُوا نَعَمْ‏.‏ قَالَ ‏"‏ صَلُّوا عَلَى صَاحِبِكُمْ ‏"‏‏.‏ قَالَ أَبُو قَتَادَةَ عَلَىَّ دَيْنُهُ يَا رَسُولَ اللَّهِ‏.‏ فَصَلَّى عَلَيْهِ‏.‏
Reference : Sahih al-Bukhari 2295
In-book reference : Book 39, Hadith 6
USC-MSA web (English) reference : Vol. 3, Book 37, Hadith 492
  (deprecated numbering scheme)