The history of the Kazakh Khanate in the XV-XVIII centuries
The Kazakh Khanate was founded in 1456-1465 by Janybek Khan and Kerey Khan, on the banks of Jetysu ("seven rivers") in the southeastern part of the present-day Republic of Kazakhstan. The founding of the Kazakh Khanate is considered the ethnogenesis of the Kazakh nation. The formation of the independent Kazakh Khanate began when several tribes under the rule of sultans Janybek and Kerey departed from the Khanate of Abul Khair Khan. The sultans led their people toward Mogolistan, eventually settling and founding an independent state. The new Khanate soon became a buffer state between the Mongolians and the Khanate of Abul Khair.
Although both Janybek Khan and Karai Khan were considered the founding rulers of the Kazakh Khanate, it was Kerei Khan who initially wielded the most power. Upon the death of Kerei Khan in 1470, Janybek Khan became the sole rule. The early years of the Kazakh Khanate were marked by struggles for control of the steppe against the Uzbek leader Muhammad Shaybani. In 1470, the Kazakhs defeated Muhammad Shaybani at Turkestan (City), forcing the Uzbeks to retreat south to Samarkand and Bukhara.
In 1480 Karai Khan's son Baranduk became khan. During his reign the Kazakhs were able to muster an army of 50,000 men and to repeatedly defeat the forces of Muhammad Shaybani along the Syr Darya river.
In the manuscript of "Tarikh-Safavi," written in the ancient Persian by Persian historians wrote about Kasim Khan ruler of Dasht-i-Kipchak. The manuscript was writing about how the Kazakh squad of soldiers helped Bukhara Khan Sheibani annex the Iranian city of Khorasan. Kasim Khan committed squad of eight thousand dzhigits and Khorasan was taken.
During the reign of Kasym Khan, the territories of the Kazakh Khanate expanded considerably. As Mirza Muhammad Haidar Dughlat later wrote in his Tarikh-i-Rashidi, "Kasym Khan now brought the Dasht-i-Kipchak under his absolute control, in a manner that no one, with the exception of Jochi, had ever done before. His army exceeded a thousand thousand". Kasym Khan instituted the first Kazakh code of laws in 1520, called "Qasım xannıñ qazqa jolı". Kasym Khan also ratified his alliance with the Timurid leader Babur, particularly after the fall of the Shaybanids, and was thus praised by the Mughals and the populace of Samarqand.
Under Khak-Nazar Khan the Kazakh Khanate faced competition from several directions: the Nogai Horde in the west, the Khanate of Sibir in the north, Moghulistan in the east and the Khanate of Bukhara in the south. Initially, Khak-Nazar Khan led the Kazakhs into two major battles against Khanate of Bukhara at Tashkent, then against the Chagatai leader Abdur-Rashid Khan. In 1568, the Kazakhs successfully defeated the Nogai Horde at Emba River and reached Astrakhan, but were repelled by Russian forces.
Tauke Khan was elected as the leader of the Kazakh Khanate, immediately after the death of Salqam-Jangir Khan and he lead the battered Kazakh warriors across the steppes to resist the advancement of the Dzungars. Unfortunately the already weakened Kazakhs were once again faced with defeat at Sayram and soon lost many major cities to the Dzungars.
Tauke Khan, soon sought alliances with the Kirghiz in the south-east who were also facing a Dzungar invasion in their Issyk-Kul Lake region and even the Uyghurs of the Tarim Basin. In 1687, Dzungars besieged Hazrat-e Turkestan and were forced to retreat after the arrival of the Uzbeks led by Subhan Quli Khan.
In 1697, Tsewang Rabtan became the leader of the Dzungar Khanate, and he dispatched several of his commanders to subjugate Tauke Khan and many major wars between the Dzungars and the Kazakh Khanate continued into the years: (1709, 1711—1712, 1714 and 1718). The Kazakh Khanate had indeed been weakened by the confrontation and nearly one-third of their population had been decimated by the ensuing conflict. With Tauke Khan's death in 1718, the Kazakh Khanate splintered into three Jüz — the Great jüz, the Middle jüz and the Little jüz. Each Jüz had its own Khan from this time onward.