Ata bin Abi Rabah narrated from Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) that a man of the Ansar freed his slave as a mudabbar while he himself was in need. This was mentioned to the Prophet (peace and blessings be upon him), so he (peace and blessings be upon him) sent for him and asked: "Have you freed your slave?" He said: Yes. The Prophet (peace and blessings be upon him) said: "But you are the one in need of him." Then he said: "Who will buy him from me?" Sayyiduna Nu'aym bin Abdullah (may Allah be pleased with him) said: I will. So he bought him, and the Prophet (peace and blessings be upon him) took the price and gave it to his owner.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المدبر / 21544