Muhammad bin al-Munkadir narrated from Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) that a man freed his slave, and he had no other wealth either, so the Prophet (peace and blessings be upon him) kept him as a slave, then sold him and returned the price to the owner.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المدبر / 21560