Sahih al-Bukhari 2298
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، حَدَّثَنَا اللَّيْثُ، عَنْ عُقَيْلٍ، عَنِ ابْنِ شِهَابٍ، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ يُؤْتَى بِالرَّجُلِ الْمُتَوَفَّى عَلَيْهِ الدَّيْنُ فَيَسْأَلُ هَلْ تَرَكَ لِدَيْنِهِ فَضْلاً ". فَإِنْ حُدِّثَ أَنَّهُ تَرَكَ لِدَيْنِهِ وَفَاءً صَلَّى، وَإِلاَّ قَالَ لِلْمُسْلِمِينَ " صَلُّوا عَلَى صَاحِبِكُمْ ". فَلَمَّا فَتَحَ اللَّهُ عَلَيْهِ الْفُتُوحَ قَالَ " أَنَا أَوْلَى بِالْمُؤْمِنِينَ مِنْ أَنْفُسِهِمْ، فَمَنْ تُوُفِّيَ مِنَ الْمُؤْمِنِينَ فَتَرَكَ دَيْنًا فَعَلَىَّ قَضَاؤُهُ، وَمَنْ تَرَكَ مَالاً فَلِوَرَثَتِهِ "."
Narrated Abu Huraira:
Whenever a dead man in debt was brought to Allah's Messenger (ﷺ) he would ask, "Has he left anything to repay his debt?" If he was informed that he had left something to repay his debts, he would offer his funeral prayer, otherwise he would tell the Muslims to offer their friend's funeral prayer. When Allah made the Prophet (ﷺ) wealthy through conquests, he said, "I am more rightful than other believers to be the guardian of the believers, so if a Muslim dies while in debt, I am responsible for the repayment of his debt, and whoever leaves wealth (after his death) it will belong to his heirs. "
Full reference and source
Sahih al-Bukhari 2298 In-book : Book 39, Hadith 9 USC-MSA web (English) : Vol. 3, Book 37, Hadith 495 (deprecated)
View source on Sunnah.com (opens in a new tab)