If a person owes khums or zakat, and ḥajjat al‑islām[2] is obligatory for him, and he has debt as well, then, if he dies and his estate is not sufficient for all of these obligations, in the event that the wealth on which khums and zakat is obligatory has not perished, the khums and zakat must be paid and the rest of his estate must be used to settle his debt. However, if the property on which khums and zakat is obligatory has perished, his estate must be used to settle his debt.
If after this anything is left, it must be spent for [hiring someone to perform] hajj [on the deceased’s behalf]; and if after this anything remains, it must be divided between the khums and zakat debts.