The description provided perfectly matches the early life and rise of Qutub-ud-din Aibak. Born in Turkestan, he was captured and sold into slavery as a child. He was purchased by Qazi Fakhruddin Abdul Aziz Kufi in Nishapur. After the Qazi's death, his son sold Aibak to a merchant, from whom he was eventually purchased by Muhammad of Ghur. Aibak's military talents led to his rapid promotion, becoming a trusted general and later viceroy of Muhammad of Ghur's Indian territories. After Ghur's death, Aibak established the Delhi Sultanate, founding the Mamluk or Slave dynasty.