It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that a man came to the Prophet (peace and blessings be upon him) and said: My father is a very old man and does not have the strength to perform Hajj; may I perform Hajj on his behalf? He (peace and blessings be upon him) said: "Yes. Tell me, if he had a debt and you paid it on his behalf, would that not suffice for him? So this is just like that."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11154