A slave came and pledged allegiance to the Messenger of Allah ﷺ for emigration, and the Messenger of Allah ﷺ did not realize he was a slave. Then his master came looking for him, and the Prophet ﷺ said, "Sell him to me." So he bought him for two black slaves. After that, he would not accept anyone's pledge until he asked whether he was a slave.
حدثنا حجين حدثنا ليث عن أبي الزبير وإسحاق بن عيسى حدثنا ليث حدثني أبو الزبير
جاء عبد فبايع رسول الله ﷺ على الهجرة ولم يشعر رسول الله ﷺ أنه عبد فجاء سيده يريده فقال النبي ﷺ بعنيه فاشتراه بعبدين أسودين ثم لم يبايع أحدا بعد حتى يسأله أعبد هو
Its isnad is sahih. It is found in Muslim 3/1225, no. 1602, in the chapter on al-Musaqah, on the permissibility of selling one animal for another, and in Tirmidhi 3/531, no. 1239, in the chapter on sales, on what has been said about buying a slave for two slaves, where he said, hasan sahih, and in Nasai 7/150, no. 4184, in the chapter on the pledge, on the pledge of slaves, and in Ibn Majah 2/958, no. 2869, in the chapter on jihad, on the pledge.