A slave came and pledged allegiance to the Messenger of Allah ﷺ for emigration, and the Prophet ﷺ did not realize that he was a slave. Then his master came, and the Prophet ﷺ said, "Sell him to me." So he bought him in exchange for two black slaves. After that, he would not accept anyone's pledge until he asked whether he was a slave.
حدثنا قتيبة حدثنا الليث بن سعد عن أبي الزبير
جاء عبد فبايع رسول الله ﷺ على الهجرة ولا يشعر النبي ﷺ أنه عبد فجاء سيده فقال النبي ﷺ بعنيه فاشتراه بعبدين أسودين ولم يبايع أحدا بعد حتى يسأله أعبد هو
Reference: also narrated by Muslim, in the Book of Musaqah, chapter on the permissibility of selling animals for animals of the same kind unequally, hadith no. 1602, from Qutayba, with the same wording. There is also a report on this subject from Ibn Abbas [I could not find it].