In a sort of "Rising through the ranks" way.
Baybars was a Mamluk in Egypt who rose to be commander of the Mamluks and Sultan of Egpyt. Mamluks were slave militias that fought in Muslim armies. But they were a bit unusual as slaves since they could acquire quite a bit of wealth and power.