 After the death of Ghiyath in 1202, the Ghurid chieftains supported Atsiz to become the new ruler of the Ghurid dynasty.However, Mu'izz al-Din managed keep him away from the Ghurid chieftains and send him to the court of his relatives in Bamiyan, where Atsiz's daughter married the eldest son of the Bamiyan ruler Baha al-Din Sam II.After the death of Mu'izz al-Din in 1206, his nephew Ghiyath al-Din Mahmud succeeded him as the ruler of the Ghurid dynasty.