Slavery is acceptable in Islam. The Qur’an has Allah telling Muhammad that he has given him girls as sex slaves: “Prophet, We have made lawful to you the wives to whom you have granted dowries and the slave girls whom God has given you as booty.” (Qur’an 33:50)
Muhammad bought slaves: “Jabir (Allah be pleased with him) reported: There came a slave and pledged allegiance to Allah’s Apostle (may peace be upon him) on migration; he (the Holy Prophet) did not know that he was a slave. Then there came his master and demanded him back, whereupon Allah’s Apostle (may peace be upon him) said: Sell him to me. And he bought him for two black slaves, and he did not afterwards take allegiance from anyone until he had asked him whether he was a slave (or a free man).” (Muslim 3901)
Muhammad took female Infidel captives as slaves: “Narrated Anas: The Prophet offered the Fajr Prayer near Khaibar when it was still dark and then said, ‘Allahu-Akbar! Khaibar is destroyed, for whenever we approach a (hostile) nation (to fight), then evil will be the morning for those who have been warned.’ Then the inhabitants of Khaibar came out running on the roads. The Prophet had their warriors killed, their offspring and woman taken as captives. Safiya was amongst the captives. She first came in the share of Dahya Alkali but later on she belonged to the Prophet. The Prophet made her manumission as her ‘Mahr.’” (Bukhari 5.59.512) Mahr is bride price: Muhammad freed her and married her. But he didn’t do this to all his slaves:
Muhammad owned slaves: “Narrated Anas bin Malik: Allah’s Apostle was on a journey and he had a black slave called Anjasha, and he was driving the camels (very fast, and there were women riding on those camels). Allah’s Apostle said, ‘Waihaka (May Allah be merciful to you), O Anjasha! Drive slowly (the camels) with the glass vessels (women)!’” (Bukhari 8.73.182) There is no mention of Muhammad’s freeing Anjasha.