Satuk Bughra Khan
On the other hand, Arslan Ilig Muhammad b. Ali had attained a very strong position within the state. Ahmad b. al-Hasan, who objected to this position of his, captured Özkent and Akhsikath (1019-20). Meanwhile Ali Tegin, who had managed to escape from the hands of Mansur b. Ali, seized Bukhara with the help of Arslan b. Seljuk and began to rule in this city (1020-21).
Mansur b. Ali, who appears to have been a pious man, abandoned the khaganate and became a dervish (1024-25). He was succeeded by Yusuf Kadır Khan. Muhammad b. Ali must also have died at roughly this time. Two brothers united against Yusuf's rule. One of them, Ahmad, proclaimed himself great khagan, and Ali Tegin supported him. Yusuf was again compelled to come to terms with Mahmud of Ghazni. These two rulers, meeting near Samarkand, reached decisions not only on matters concerning the Karakhanids but also on the transfer of Arslan b. Seljuk and the Oghuz under his command to Khorasan. It was also agreed to establish ties of kinship between the two dynasties (1025).
Sultan Mahmud had Arslan b. Seljuk seized by a ruse and imprisoned him in the fortress of Kalinjar in India. Ali Tegin fled to the steppes, but after Mahmud returned to his own country he again became master of Bukhara and Samarkand. Sultan Mahmud brought the former Samanid lands under his rule and made an agreement with the Karakhanids that their relations with the Abbasid caliph would be conducted through him. Yusuf Kadır Khan and his sons later improved their position and succeeded in capturing first Özkent (1025-26) and then the capital Balasagun (1026-27). Ahmad b. al-Hasan too was compelled to recognize Yusuf's sovereignty.
In the spring of 1031, Yusuf Kadır did not receive well the embassy that the Ghaznavid Sultan Mas'ud had sent to announce his accession to the throne and to establish friendly relations between the two dynasties. However, upon his death (December 1032 - January 1033) and the succession of his sons Arslan Khan Sulayman and Bughra Khan Muhammad, the embassy sent by Sultan Mas'ud succeeded in concluding an agreement. Later, Mas'ud also resolved, through another embassy he sent, the dispute arising from the giving of the Ghaznavid princess Zaynab in marriage to the Karakhanid Bughra Khan Muhammad, and came to terms with the two brothers once again.
