Sayyiduna Jabir (may Allah be pleased with him) narrates: A slave came and pledged allegiance for migration at the blessed hand of the Prophet (peace and blessings be upon him). The Prophet (peace and blessings be upon him) did not know that he was a slave. His master came searching for him, so the Prophet (peace and blessings be upon him) said: Sell him to me. Thus, the Prophet (peace and blessings be upon him) bought him in exchange for two black slaves. After that, whenever the Prophet (peace and blessings be upon him) took allegiance from anyone, he would first ask whether he was a slave or not.
Hadith Referenceصحیح ابن حبان / كتاب البيوع / 5027
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «الترمذي» (1262): م.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح