´Abdullah bin Abi Qatadah narrated from his father that:` The Prophet was brought a (deceased) man to perform Salat over. So the Prophet said: "Pray for your companion; for indeed he had a debt upon him." Abu Qatadah said: "It shall be upon me." So the Messenger of Allah said: "To pay it off?" (He said: "To pay it off.") So he performed the prayer for him.
Hadith Referenceسنن ترمذي / كتاب الجنائز عن رسول الله صلى الله عليه وسلم / 1069
´Abu Hurairah narrated:` "A deceased man would be brought to the Messenger of Allah while a debt was due upon him. So he would say: 'Has he left anything to pay off his debt?' If he was told that he had left something to pay it then he would pray (the funeral prayer) for him. Otherwise he would tell the Muslims: 'Pray for your companion.' So when Allah granted him the victories, he stood and said: 'I am more worthy in the case of the believers than they themselves are. So whoever among the believers dies and leaves a debt behind, then it is up to me to fulfill it. And whoever leaves wealth behind, then it is for his heirs.'"
Hadith Referenceسنن ترمذي / كتاب الجنائز عن رسول الله صلى الله عليه وسلم / 1070
Hadith Gradingالألبانی:صحيح، ابن ماجة (2415)
Hadith Takhrij«صحیح البخاری/الکفارة 5 (2298) والنفقات 15 (5371) صحیح مسلم/الفرائض 4 (1619) ( تحفة الأشراف : 152116) مسند احمد (2/453) (صحیح) وأخرجہ کل من: سنن النسائی/الجنائز67 (1965) سنن ابن ماجہ/الصدقات13 (2415) مسند احمد (2/290) من غیر ہذا الوجہ، وأخرجہ: صحیح البخاری/الاستقراض 11 (2398، 2399) وتفسیر الاقراب 1 (4791) والفرائض 4 (6731) و15 (6745) و25 (6763) صحیح مسلم/الفرائض (المصدرالمذکور) مسند احمد (2/456) مغتصرا ومن غیر ہذا الوجہ۔»