Abu al-Zubayr said that Sayyiduna Jabir (may Allah be pleased with him) narrated that a man of the Ansar, who was known as Abu Madhkur, freed his slave whose name was Ya'qub, and he had no wealth other than him. The Messenger of Allah (peace and blessings be upon him) called for him and said: "Who will buy him from me?" Nu'aym bin Abdullah al-Nahham (may Allah be pleased with him) bought him for eight hundred dirhams. Then the Messenger of Allah (peace and blessings be upon him) returned the price to his owner, and he (peace and blessings be upon him) said: "When one of you is poor, let him begin with himself. If there is a surplus, then on his family. If there is still a surplus, then on his near relatives; and if there is still a surplus, then wherever there is need."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المدبر / 21539