The existence of slavery is an ancient condition. It was there long before there was Islam.

Islam may not have been entirely successful in eliminating slavery; however I can safely say Islam was the only religion to recommend the freeing of a slave as a way of exemption of sins.