Ali ibn Hasan, also known as Harun Bughra Khan and better known as Ali-Tegin (also spelled Alitigin) was a Karakhanid ruler in Transoxiana from 1020 to 1034 with a brief interruption in 1024/25.
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.
With these Oghuz Turks in his grasp, Ali-Tegin seized Bukhara and soon occupied all of Sogdia; after his conquest of the region, he took the titles of "Yïgan-tigin" and "Arslan Ilig".
[9] 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 aggressive policy towards Ali-Tegin; Mas'ud now intended to once and for all conquer Transoxiana 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 an inconclusive battle was shortly fought at Dabusiyya; Altun Tash died during the battle,[10] but one of his most trusted officers, Ahmad Shirazi, successfully negotiated a treaty with Ali-Tegin, who agreed to return to Samarkand, whilst the Ghaznavid army withdrew back to their own territories.