Salama bin Akwa reported,

We were sitting with the Prophet ﷺ when a funeral bier was brought to him. The people said, "Pray over him."He asked, "Did he have any debt?"They replied, "No."He asked, "Did he leave anything behind?"They said, "No."So he prayed over him.Then another bier was brought. They said, "Messenger of Allah, pray over him."He asked, "Did he have any debt?"It was said, "Yes."He asked, "Did he leave anything behind?"They replied, "Three dinars."So he prayed over him.Then a third was brought. They said, "Pray over him."He asked, "Did he leave anything behind?"They said, "No."He asked, "Did he have any debt?"They replied, "Three dinars."He said, "Pray over your companion yourselves."Abu Qatada said, "Pray over him, Messenger of Allah, and his debt is upon me."So he prayed over him.

Bukhari 2289

Sahih

حدثنا المكي بن إبراهيم حدثنا يزيد بن أبي عبيد

عن سلمة بن الأكوع رضي الله عنه قال

كنا جلوسا عند النبي ﷺ إذ أتي بجنازة فقالوا صل عليها فقال هل عليه دين قالوا لا قال فهل ترك شيئا قالوا لا فصلى عليه ثم أتي بجنازة أخرى فقالوا يا رسول الله صل عليها قال هل عليه دين قيل نعم قال فهل ترك شيئا قالوا ثلاثة دنانير فصلى عليها ثم أتي بالثالثة فقالوا صل عليها قال هل ترك شيئا قالوا لا قال فهل عليه دين قالوا ثلاثة دنانير قال صلوا على صاحبكم قال أبو قتادة صل عليه يا رسول الله وعلي دينه فصلى عليه

البخاري 2289صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Transfers
Chapter
If the debt of the deceased is transferred to a man, it is permissible
Numbering
Darussalam 2289
Bukhari 2289