Narrated Salama bin Al-Akwa`
A dead person was brought to the Prophet (ﷺ) so that he might lead the funeral prayer for him. He asked, "Is he in debt?" When the people replied in the negative, he led the funeral prayer. Another dead person was brought and he asked, "Is he in debt?" They said, "Yes." He (refused to lead the prayer and) said, "Lead the prayer of your friend." Abu Qatada said, "O Allah's Messenger (ﷺ)! I undertake to pay his debt." Allah's Messenger (ﷺ) then led his funeral prayer.
Narrated Aisha
(wife of the Prophet) Since I reached the age when I could remember things, I have seen my parents worshipping according to the right faith of Islam. Not a single day passed but Allah's Messenger (ﷺ) visited us both in the morning and in the evening. When the Muslims were persecuted, Abu Bakr set out for Ethiopia as an emigrant. When he reached a place called Bark-al-Ghimad, he met Ibn Ad-Daghna, the chief of the Qara tribe, who asked Abu Bakr, "Where are you going?" Abu Bakr said, "My people have turned me out of the country and I would like to tour the world and worship my Lord." Ibn Ad- Daghna said, "A man like you will not go out, nor will he be turned out as you help the poor earn their living, keep good relation with your Kith and kin, help the disabled (or the dependents), provide guests with food and shelter, and help people during their troubles. I am your protector. So, go back and worship your Lord at your home." Ibn Ad-Daghna went along with Abu Bakr and took him to the chiefs of Quraish saying to them, "A man like Abu Bakr will not go out, nor will he be turned out. Do you turn out a man who helps the poor earn their living, keeps good relations with Kith and kin, helps the disabled, provides guests with food and shelter, and helps the people during their troubles?" So, Quraish allowed Ibn Ad-Daghna's guarantee of protection and told Abu- Bakr that he was secure, and said to Ibn Ad-Daghna, "Advise Abu Bakr to worship his Lord in his house and to pray and read what he liked and not to hurt us and not to do these things publicly, for we fear that our sons and women may follow him." Ibn Ad-Daghna told Abu Bakr of all that, so Abu- Bakr continued worshipping his Lord in his house and did not pray or recite Qur'an aloud except in his house. Later on Abu Bakr had an idea of building a mosque in the court yard of his house. He fulfilled that idea and started praying and reciting Qur'an there publicly. The women and the offspring of the pagans started gathering around him and looking at him astonishingly. Abu Bakr was a softhearted person and could not help weeping while reciting Qur'an. This horrified the pagan chiefs of Quraish. They sent for Ibn Ad-Daghna and when he came, they said, "We have given Abu Bakr protection on condition that he will worship his Lord in his house, but he has transgressed that condition and has built a mosque in the court yard of his house and offered his prayer and recited Qur'an in public. We are afraid lest he mislead our women and offspring. So, go to him and tell him that if he wishes he can worship his Lord in his house only, and if not, then tell him to return your pledge of protection as we do not like to betray you by revoking your pledge, nor can we tolerate Abu Bakr's public declaration of Islam (his worshipping). `Aisha added: Ibn Ad-Daghna came to Abu Bakr and said, "You know the conditions on which I gave you protection, so you should either abide by those conditions or revoke my protection, as I do not like to hear the 'Arabs saying that Ibn Ad-Daghna gave the pledge of protection to a person and his people did not respect it." Abu Bakr said, "I revoke your pledge of protection and am satisfied with Allah's protection." At that time Allah's Messenger (ﷺ) was still in Mecca and he said to his companions, "Your place of emigration has been shown to me. I have seen salty land, planted with date-palms and situated between two mountains which are the two,Harras." So, when the Prophet (ﷺ) told it, some of the companions migrated to Medina, and some of those who had migrated to Ethiopia returned to Medina. When Abu Bakr prepared for emigration, Allah's Messenger (ﷺ) said to him, "Wait, for I expect to be permitted to emigrate." Abu Bakr asked, "May my father be sacrificed for your sake, do you really expect that?" Allah's Messenger (ﷺ) replied in the affirmative. So, Abu Bakr postponed his departure in order to accompany Allah's Messenger (ﷺ) and fed two camels which he had, with the leaves of Samor trees for four months.
Narrated Abu Huraira
Whenever a dead man in debt was brought to Allah's Messenger (ﷺ) he would ask, "Has he left anything to repay his debt?" If he was informed that he had left something to repay his debts, he would offer his funeral prayer, otherwise he would tell the Muslims to offer their friend's funeral prayer. When Allah made the Prophet (ﷺ) wealthy through conquests, he said, "I am more rightful than other believers to be the guardian of the believers, so if a Muslim dies while in debt, I am responsible for the repayment of his debt, and whoever leaves wealth (after his death) it will belong to his heirs. "