Dirham of Ali-Tegin, minted at Dabusiyya in 1032/3
|Ruler of Transoxiana|
|Reign||1020 – 1034|
|Predecessor||Mansur Arslan Khan|
|Successor||Ebu Shuca Sulayman|
He was the son of Hasan ibn Sulayman Bughra Khan (simply called "Bughra Khan" in Persian sources), who was the eponymous ancestor of eastern branch of the Karakhanid family, known as the "Hasanids", which Ali-Tegin belonged to. Hasan is only known from Persian sources because of his wars with the Iranian Samanids, who used to be the rulers of Transoxiana before the Karakhanids under Nasr Khan annexed their territories in 999.
Ali-Tegin is first mentioned as being thrown in prison under the orders of his opponent Mansur Arslan Khan, but quickly managed to escape and receive help from a group of Oghuz Turks led by the Seljuq chief Arslan Isra'il. With these Oghuz Turks under his grasp, Ali-Tegin seized Bukhara and soon occupied all of Sogdia; after his conquest of the region, he took the title of "Yïgan-tigin" and another title of "Arslan Ilig". He gave his daughter in marriage to Arslan Isra'il. With the possession of the wealthy and important cities of Bukhara and Samarkand, Ali-Tegin became a powerful and influential figure in Central Asia; however, this strained his relations with his jealous brother Yusuf Qadir Khan hostile, which resulted in the latter allying himself with the Ghaznavid Sultan Mahmud (r. 998–1030), who had received expression of discontent from Ali-Tegin's subjects and was himself annoyed by Ali-Tegin, who did not allow him to send envoys to Qadir Khan, whose territories consisted of the important cities of Khotan and Kashgar. Ali-Tegin, after having received the news of his brother's alliance with the Ghaznavids, responded by allying himself with his other brother Muhammad Toghan Khan.
In 1024/5, a combined army under Mahmud and Qadir Khan invaded Ali-Tegin's territories and completely defeated him and his Seljuq supporters. Ali-Tegin then fled to the steppes, whilst Mahmud and Qadir Khan made a marriage alliance at Samarkand. Mahmud also managed to take the family of Ali-Tegin captive, which was fleeing towards the steppes, but was captured by an officer of his. Meanwhile, Arslan Isra'il fled to Ghaznavid territory in Khorasan and asked for permission to settle in the region in return for protecting the Ghaznavid borders from incursions by the other Turks of Transoxiana. Mahmud, not trusting him and his followers, had them imprisoned.
Fortunately for Ali-Tegin, Mahmud had to withdraw from Transoxiana in order to prepare another expion in India, which gave him the opportunity to make a counter-attack against Qadir Khan and re-conquer his former territories. Ali-Tegin, although not with the support of Arslan Isra'il any longer, still had support from the latter's nephews Tughril and Chaghri Beg. Ali-Tegin had a quarrel with the Seljuqs in 1029, but they still continued to serve and support him.
After a brief civil war in the Ghaznavid state in 1030, Mahmud's son Mas'ud I became the new ruler of the Ghaznavid Empire, and continued his father's behavior of aggression towards Ali-Tegin; Mas'ud now intended to once and for all conquer Transoxania from Ali-Tegin and to give it to Qadir Khan's second son, who was his own brother-in-law, Muhammad Bughra Khan. In 1032, the Ghaznavid governor of Khwarazm, Altun Tash, captured Bukhara, and a battle was shortly fought at Dabusiyya, which became inconclusive; Altun Tash died during the battle, but one of his most trusted officer, Ahmad Shirazi, managed to successfully negotiate with Ali-Tegin, who agreed to return to Samarkand, whilst the Ghaznavid army withdrew back to their own territories.
Meanwhile, in Khwarazm, Altun-Tash's son Harun became the new ruler of the region. However, unlike his father, he was hostile to the Ghaznavids and in 1034 made an alliance with Ali-Tegin, with whom he planned to invade Khorasan. However, before the invasion took place, Harun was assassinated by his own slaves, at the instigation of Mas'ud. Ali-Tegin died in the same year; his sons continued to preserve their father's authority in Transoxiana for a few years, until their relative Böritigin (r. 1038–1068) of the Alid branch seized their territories.