If the guarantor was given donations or zakaah and paid off what the borrower whom he guaranteed refused to pay, can he demand that the latter pay him back?
Question

One man acted as guarantor for another regarding a loan of money. When the time came to pay back the money, the borrower did not pay it back, so that the guarantor had to pay. Thus the guarantor went into debt, because he did not have the means to pay back the loan. Therefore he went to some good people and told them that he was in debt, so they paid it off for him. Then he went to ask the debtor for the money. Does he have the right to take the money as a kind of “booty”, or should he pay it back to the good people who paid off his debt?
Praise be to Allah.Firstly:
Acting as a guarantor is a commitment from one whose donation of money is valid to pay off a debt for someone else, but the debt remains something owed by the other person.
The basic principle is that the lender may demand payment from the guarantor or from the one whom he guaranteed.
It says in Kashshaaf al-Qinaa‘ (3/364): The lender has the right to ask whichever of them he wants, meaning the one who is guaranteed and the guarantor, because both of them are responsible for paying the debt. So the one who is guaranteed cannot be absolved of the responsibility of paying the debt merely by virtue of the guarantee of the guarantor. Rather both of them are responsible for it, because if the guarantor says, “I guarantee that you could ask me for money but I cannot guarantee that I will pay,” that is not valid according to consensus. This was stated in al-Mubdi‘. End quote.
According to some of the fuqaha’ it is permissible to have a particular order of guarantee when requesting payment. So the guarantor may stipulate a condition that the lender should not come and ask him except when the borrower is unable or refuses to pay.
In al-Ma‘aayeer ash-Shar‘iyyah (p. 132), it says: The lender has the right to demand payment from the borrower or the guarantor, and he has the choice to ask whichever of them he wishes.
The guarantor has the right to stipulate a particular order of guarantee, such as stipulating that the lender should ask the borrower first, then if he refuses, he may refer to the guarantor. End quote.
Secondly:
If the borrower did not pay, and the demand for payment is made to the guarantor, but he does not have any money, it is permissible to give him zakaah or charitable funds with which to pay off the debt, and the borrower is then absolved.
In that case, the guarantor does not have the right to demand payment from the borrower.
It says in Mughni al-Muhtaaj (3/217): The guarantor who has the responsibility of paying may go and demand payment from the original debtor, if the original debtor gave him permission to act as his guarantor and pay the debt on his behalf, because he paid from his own pocket in order to benefit someone else with his permission. This applies if he pays from his own pocket. But if he took money from zakaah funds and paid off the debt with it, then he cannot go back and demand money [from the debtor], as they mentioned in the section on charity. End quote.
Based on that, the guarantor does not have the right to demand money from the borrower, unless he paid from his own pocket.
He does not have the right to take [charity] money and spend it on anything other than paying off the debt, regardless of whether he took it from zakaah funds or other charitable funds.
Al-Bahooti said in Kashshaaf al-Qinaa‘ (2/282): If the debtor is given money with which to pay off his debt, it is not permissible for him to spend it on anything else, even if he is poor, because he only received it for a specific purpose.
Therefore, what was given to him of zakaah funds should be taken back from him – meaning from a slave who has a contract of manumission, a debtor, a fighter in Allah’s cause and a wayfarer, if someone else paid off what was owed by the slave with a contract of manumission or the debtor, or if the one who took zakaah to pay off a debt was let off his debt, or if the debtor or wayfarer has something left over from what he was given. End quote.
Shaykh Sulaymaan ibn ‘Umar al-Jamal (may Allah have mercy on him) said: If he gave him some dates with which to break his fast, then that is what he must do with them, as appears to be the case. So it is not permissible for him to use them for any other purpose, because this is what the giver stipulated." (Haashiyat al-Jamal ‘ala Sharh al-Manhaj  2/328).
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: The basic principle in our view regarding this matter is that the one who took money from people for a specific purpose should not spend it on anything else except after asking their permission." (Al-Liqa’ ash-Shahri  4/9).
Based on that, the sponsor must tell the person whom he sponsored that the debt has been paid off in full.
And Allah knows best.