Kazakh War of Independence

With the help of Ulugh Beg, who was a Timurid khan, he dethroned Kepek, Olugh Mokhammad and Dawlat Berdi that all were claiming the throne for the Horde as theirs.

Barak seized control of the White Horde that was populated by the Uzbeks, whom referred to Turkic tribes that roamed over the present-day Kazakhstan and Uzbekistan.

After the death of Barak in which Ulugh was in conspired in, the title was passed to Abu'l-Khayr Khan of the Shaybanids who founded the Uzbek Khanate in 1428.

The Oirats raided the Uzbek lands where they burned and looted cities thus destroying its economy while Abu'l-Khayr himself had lost reputation among the nomad clans.

With the Khan of Moghulistan Esen Buqa II's permission, they settled in the valleys of Chu and Talas rivers to establish the Kazakh Khanate in 1465.

Abu'l-Khayr Khan refused to recognize Janibek's claim over the land and in response, he sent an expedition force in 1468 to oppose the Kazakhs but died on the way.

Mahmud, the eldest son of Janibek, took Sozaq while Erenshy had managed to capture Sawran where he faced and defeated Shaybani thus forcing him to flee back to Bukhara.

After the death of Kerei Khan in 1473, ambassadors sent by Bey Musa Mirza from Nogai Horde offered an alliance between the Manghuds and the Shaybanids.

His victory at the Sagunlyk Pass in the Karatau Mountains, and then in Ortyrar, Iasy (present-day Turkistan), and Arquq forced Muhammad Shaybani to abandon talks with Musa and the agreement did not take place.

Muhammad Shaybani instead chose to ally with the Moghuls and with their help in 1485, he seized the cities of Syghnaq, Arkuk and Uzgend on the Syr Darya, but was eventually ousted by Buryndyq, Qasym, and Ádik Sultan in 1486.

Kasym Khan, saw those cities places as an economic and military support of his power over the populations in nomadic regions which constantly worried the Shaybanids in the border areas of Turkestan and Tashkent.

Using the advantage during the political instability in Central Asia, Kasym Khan supported the Timurid Babur in 1512 when the Shaybanids again gained power over him.

At the end of 1513, he proposed to organize a joint campaign against Tashkent, but Kasym refused, citing the need to prepare for winter, since the collection and construction of troops at that time were not feasible.