A slave came and pledged allegiance to the Prophet ﷺ for emigration, and the Prophet ﷺ did not realize that he was a slave. Then his master came looking for him, so the Prophet ﷺ said, "Sell him to me," and he bought him in exchange for two black slaves. After that, he would not accept anyone's pledge until he had asked whether he was a slave.
أخبرنا قتيبة قال حدثنا الليث عن أبي الزبير
جاء عبد فبايع النبي ﷺ على الهجرة ولا يشعر النبي ﷺ أنه عبد فجاء سيده يريده فقال النبي ﷺ بعنيه فاشتراه بعبدين أسودين ثم لم يبايع أحدا حتى يسأله أعبد هو
Reported by Muslim in "The Book of Sharecropping," chapter on the permissibility of selling an animal for an animal of the same kind with disparity in value, no. 1602, from Qutayba through him, and it is also in Al-Kubra, no. 7807.