Mishkat al-Masabih 2913
Abu Huraira said that:
A man who had died in debt would be brought to God’s Messenger and he would ask whether he had left any-thing to discharge his debt. If he was told ^that he had left enough he would pray, otherwise he would tell the Muslims to pray over their friend. But when God wrought the conquests at his hands he stood up and said, “I am closer to the believers than their own selves (Al-Qur’an 33:6), so if any of the believers dies leaving a debt I shall be responsible for paying it, and if anyone leaves property it goes to his heirs.” 

(Bukhari and Muslim.)
وَعَنْ أَبِي هُرَيْرَةَ قَالَ: كَانَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يُؤْتَى بِالرَّجُلِ الْمُتَوَفَّى عَلَيْهِ الدِّينُ فَيَسْأَلُ: «هَلْ تَرَكَ لِدَيْنِهِ قَضَاءً؟» فَإِنْ حُدِّثَ أَنَّهُ تَرَكَ وَفَاءً صَلَّى وَإِلَّا قَالَ لِلْمُسْلِمِينَ: «صَلُّوا عَلَى صَاحِبِكُمْ» . فَلَمَّا فَتَحَ اللَّهُ عَلَيْهِ الْفُتُوحَ قَامَ فَقَالَ: «أَنَا أَوْلَى بِالْمُؤْمِنِينَ مِنْ أَنْفُسِهِمْ فَمَنْ تُوفِّيَ مِنَ الْمُؤْمِنِينَ فَتَرَكَ دينا فعلي قَضَاؤُهُ وَمن ترك فَهُوَ لوَرثَته»