Sunnah.com reference : Book 7, Hadith 121English translation : Book 7, Hadith 882Arabic reference : Book 7, Hadith 878
Narrated Abu Hurairah (RA):
A man who had died in debt would be brought to Allah's Messenger (ﷺ) and he would ask, "Has he left anything to discharge his debt?" If he was told that he left enough he would pray over him. Otherwise, he would say, "Pray over your companion." Then, when Allah brought the conquests (of other lands) at his hands he said, "I am closer to the believers than their own selves. So, whoever dies leaving a debt, the responsibility for repaying it shall be upon me."

[Agreed upon].
وَعَنْ أَبِي هُرَيْرَةَ ‏- رضى الله عنه ‏- { أَنَّ رَسُولَ اَللَّهِ ‏- صلى الله عليه وسلم ‏-كَانَ يُؤْتَى بِالرَّجُلِ اَلْمُتَوَفَّى عَلَيْهِ اَلدَّيْنُ, فَيَسْأَلُ: " هَلْ تَرَكَ لِدَيْنِهِ مِنْ قَضَاءٍ? " فَإِنْ حُدِّثَ أَنَّهُ تَرَكَ وَفَاءً صَلَّى عَلَيْهِ, وَإِلَّا قَالَ: " صَلُّوا عَلَى صَاحِبِكُمْ " فَلَمَّا فَتَحَ اَللَّهُ عَلَيْهِ اَلْفُتُوحَ قَالَ: " أَنَا أَوْلَى بِالْمُؤْمِنِينَ مِنْ أَنْفُسِهِمْ, فَمَنْ تُوُفِّيَ, وَعَلَيْهِ دَيْنٌ فَعَلَيَّ قَضَاؤُهُ }  مُتَّفَقٌ عَلَيْهِ  1‏ .‏‏1 ‏- صحيح.‏ رواه البخاري ( 2398 )‏، ومسلم ( 1619 )‏، وزادا: " ومن ترك مالا فهو لورثته ".‏