Abu Hurairah reported,

Whenever a deceased man burdened with debt was brought to the Messenger of Allah ﷺ, he would ask whether the man had left behind enough to settle his debt. If he was told that the man had left enough to cover it, he would pray over him. Otherwise, he would say to the Muslims, "Pray over your companion."When Allah granted him victories and conquests, he said, "I am closer to the believers than they are to themselves. Whoever among the believers dies leaving a debt, its repayment falls upon me, and whoever leaves wealth, it goes to his heirs."

Bukhari 2298

Sahih

حدثنا يحيى بن بكير حدثنا الليث عن عقيل عن ابن شهاب عن أبي سلمة

عن أبي هريرة رضي الله عنه

أن رسول الله ﷺ كان يؤتى بالرجل المتوفى عليه الدين فيسأل هل ترك لدينه فضلا فإن حدث أنه ترك لدينه وفاء صلى وإلا قال للمسلمين صلوا على صاحبكم فلما فتح الله عليه الفتوح قال أنا أولى بالمؤمنين من أنفسهم فمن توفي من المؤمنين فترك دينا فعلي قضاؤه ومن ترك مالا فلورثته

البخاري 2298صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Guarantee
Chapter
Debt
Numbering
Darussalam 2298
Bukhari 2298