# Kazakh War of Independence

The Kazakh War of Independence (1468–1500) was a conflict fought in Central Asia between the Kazakh Khanate and the Uzbek Khanate, which attempted to maintain its control over most of modern-day Kazakhstan, which at the time was under Uzbek rule. The war started after Abu'l-Khayr, Khan of the Uzbek Khanate, attacked Zhetysu in 1468 which was controlled by a small band of rebel Kazakhs who had split from the original Uzbek Khanate. Abu’l Khayr did so in an attempt to prevent the growing Kazakh influence among the steppe. However, he died unknowingly, making it easier for the Kazakhs to expand their influence. After Abu'l-Khayr Khan's death, the Uzbeks continued to be ruled by the Shaybanids who fought against the Kazakhs in the cities that were on the Syr Darya until both sides agreed to peace in 1500 with the Kazakh Khanate gaining its sovereignty from the Uzbek control. At the end of the war, the Uzbek Khanate transferred most of Kazakhstan to the Kazakh Khanate.

## Background
### Death of Barak Khan

Barak Khan ruled the Golden Horde from 1423 to 1428. 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 that, a rivalry developed between Barak Khan and Ulugh Beg. 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. During his rule, many Turkic tribesmen were unified and came under control. As a result, the Uzbek Khanate became a major power in Central Asia. However, Abu'l-Khayr's successes were thwarted by the Oirats in the middle of the 15th century who had a superior military force. 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.

### Foundation of the Kazakh Khanate

In the fall of 1457, two sons of Barak Khan, Kerei and Janibek, in the fear of persecution Abu'l-Khayr Khan, migrated to Moghulistan by leading 200,000 tribes of supporters whom referred themselves as Kazakhs. 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. Kerei was proclaimed as the first Khan while Janibek had exercised more power.

## Course of the war

In the mid 1460’s, the Oirats raided the Uzbek Khanate again. Janibek Khan took advantage the situation by leading the Kazakhs into the Uzbek Khanate as well. 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. After his death, he was succeeded by Yadgar Khan, who died a year later of old age. Abu'l-Khayr's son, Haider Sultan, faced a more powerful opposition after assuming power which included Ibak of the Khanate of Sibir, Musa Mirza of the Nogai Horde, and Yamgurchi , the son of Yadgar Khan. From 1470 to 1471, Haider lost most of territorial possessions. In 1471, Ahmed Khan appeared with his troops in the east of the Uzbek Khanate, claiming the region Khwarezm as his. Haider Sultan was then taken by surprise from Ibak and killed. Ahmed then took a military campaign against Russia, thus allowing Abu’l-Khayr’s grandchildren to escape believing that they weren’t dangerous. One of them was Muhammad Shaybani. Before Haider’s death, Shaybani tried to regain control over the Syr Darya cities. In the beginning of 1470, with the help of Timurids he managed to capture fortresses on the Syr Darya with the goal of taking Syghnaq. However, that same year, the Kazakhs began their counter-offense. 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 gaining support in 1472, Shaybani and his forces roamed the steppe, wishing to take revenge on their enemies. He managed to kill Burek Sultan, son of Yagdar Sultan. As a result, the remnants of Burek’s ulus joined Manghuds. 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. The Manghud Beys tried to avoid Kerei and Janibek’s influence and instead proclaim a different khan who is more obedient to the will of their sultans. Shaybani accepted the offer after a promise from Musa Mirza to recognize him as the Khan of all Kazakhs while Musa himself would become the new Khan of the Golden Horde. Shaybani participated in a battle with just a few of his alleged 300 men. He managed to defeat Burunduk Khan, the son of Kerei Khan, while Khorezmi, the brother of Musa Mirza, was killed. Musa’s attempts in proclaiming Shaybani as the new khan was opposed by the Manghuds and tribes that instituted the Nogai Horde. While the negotiations dragged on, Burunduk attacked Shaybani’s possessions in the Syr Darya. 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. He hid himself in Mangyshlak after being defeated by Burunduk at the Qaratau Mountains.
In the 1480’s, Timurid ruler Sultan Ahmed Mirza invited Shaybani to fight against the Moghuls. 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.
According to some sources, when Burunduk Khan, Kasym Khan and Adik Sultan with the supporting Moghuls were in the Alatau mountains, they were attacked and defeated by a small detachment of Muhammad Shaybani’s troops. As a result, Burunduk Khan decided to become a matchmaker and the son of Muhammad Shaybani. Muhammad-Timur Sultan became Burunduk’s son-in-law who gave his other daughter to Mahmud Sultan. It is believed that this event occurred around in 1495.
A peace treaty was signed between both parties in 1500. Shaybani then focused on conquering Samarkand and Bukhara in the south from the Timurids where he established the Khanate of Bukhara and for Kazakhs to stabilize the nation which managed to consolidate its holdings.

## Aftermath

The peace between the Kazakhs and the Uzbeks was short-lived. Fearing the growth of Kazakh Khanate’s influence, Muhammad Shaybani sought to prevent it. He tried to completely stop their trade relations with Transoxiana by issuing an order towards population of Turkestan should not make any trade deals with the Kazakh merchants and attacked the cities near Syr Darya. 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. In response to his advancement to Iasy in the winter of 1510, Shaybani Khan launched an offensive against the Kasym Khan’s ulus, which was in the foothills of the Ulytau. This campaign was unsuccessful and ended in Shaybani’s defeat which caused the weakening of his influence. He died at the Battle of Marv against the Safavids in November. 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. Kata-bek, the lieutenant general of Babur in the city of Sayram called for Kasym Khan to help who was wintering in Karatal. Kasym supported him in 1513, he captured Sairam and its surroundings. Then they jointly opposed the ruler of Tashkent, Shaybanid Suyunish-koi, but near Tashkent, Kasym Khan was wounded and retreated.
Kasym maintained friendly relations with the former Khan of Western Moghulistan, Sultan Said. 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.

## In popular culture
### Movies

* Kazakh Khanate (TV series), a 2005 Kazakh historical epic film that fictionalizes account Abylai Khan's youth.
* Myn Bala, a 2011 Kazakh historical drama film set in 1729 during a war between the Kazakhs and the Dzungar Khanate.