Tirmidhi. Riyad-us-Saliheen (Hadith # 943)
[The Divine decision regarding the redemption of a deceased person remains suspended till the time its debt, if any, is paid off. The heirs, family, loved ones, and/or the believers in general must give priority to settle the debts (if any) of their deceased brethren as soon as possible.
Such was the importance given by the Messenger of Allah (may peace and blessings of Allah swt be upon him) to the settling of the debts (if any) of a deceased companion, that he (may peace and blessings of Allah swt be upon him) used to refuse to offer the funeral prayer and seek forgiveness for the deceased, until someone paid off his/her debts.]