Ahmad Niyaltigin was the treasurer of a sultan who rose to power by seizing what from his younger twin?
Mas'ud I of Ghazni Mas'ud I of Ghazni (Persian: مسعود غزنوی‎ ‎ ), known as Amīr-i Shahīd (امیر شهید ; "the martyr king")(998 – 17 January 1040), was "sultan" of the Ghaznavid Empire from 1030 to 1040. He rose to power by seizing the Ghaznavid throne from his younger twin Mohammad, who had been nominated as the heir upon the death of their father Mahmud of Ghazni. His twin was shortly blinded and imprisoned. However, when much of Mas'ud's western domains had been wrested from his control, his troops rebelled against him and reinstated Mohammad to the throne.
Izz al-Din Husayn Izz al-Din Husayn (Persian: عز الدین حسین) was the king of the Ghurid dynasty. He succeeded his father Qutb al-din Hasan in 1100. When Husayn ascended the Ghurid throne, his kingdom was in chaos. However, he managed to restore peace, and strengthen his kingdom. During Husayn's late reign, the Seljuq sultan Ahmad Sanjar invaded his domains, defeated him, and captured him. However, Sanjar later released Husayn in return for sending tribute to him. After Husayn's death in 1146, he was succeeded by his son Sayf al-Din Suri. Husayn also had 6 other sons who later divided the Ghurid kingdom among themselves.