Kazakhstan has been inhabited since the Neolithic Age: the region's climate and terrain are best suited for nomads practicing pastoralist. Archaeologists believe that humans first domesticated the horse in the region's vast steppes.
Central Asia proper was originally inhabited by Indo-Iranians. The best known of those groups was the nomadic Scythians. The Turkic people began encroaching on the Iranians starting at least in the 5th century AD, possibly before. They became the dominant ethnic component of Central Asia. While ancient cities Taraz (Aulie-Ata) and Hazrat-e Turkestan had long served as important way-stations along the Silk Road connecting East and West, real political consolidation only began with the Mongol invasion of the early 13th century. Under the Mongol Empire, administrative districts were established, and these eventually came under the emergent Kazakh Khanate (Kazakhstan).
Throughout this period, traditionally nomadic life and a livestock-based economy continued to dominate the steppe. In the 15th century, a distinct Kazakh identity began to emerge among the Turkic tribes, a process which was consolidated by the mid-16th century with the appearance of the Kazakh language, culture, and economy.
Nevertheless, the region was the focus of ever-increasing disputes between the native Kazakh emirs and the neighboring Persian-speaking peoples to the south. By the early 17th century, the Kazakh Khanate was struggling with the impact of tribal rivalries, which had effectively divided the population into the Great, Middle and Little (or Small) Hordes (jüz). Political disunion, tribal rivalries, and the diminishing importance of overland trade routes between East and West weakened the Kazakh Khanate. Khiva Khanate used this opportunity and annexed Mangyshlak Peninsula. Uzbek rule in it lasted 2 centuries until Russian arrival.
During the 17th century Kazakhs fought