The earliest records are of the 6th century AD when the Ashina clan established Turkic Kaganate or Gokturk, Kokturk state. In 766, the Qarlugs, an association of Turkic tribes, founded a state now a part of eastern Kazakhstan. The Arabs took over a few parts of Kazakhstan in the 8th and 9th centuries and Islam was introduced during this time. Till the 11th century, the Oghuz Turks ruled the western part of Kazakhstan, and the Kimak and Kipchak ruled the eastern part.
In the middle of the 12th century, Khorezm was separated from Karakitai. Mongols took over Karakitai in 1219, and Kazakhstan came under the control of the Mongolian Golden Horde. In 1456, Kazakh Khanate was established on the banks of Zhetysu. From 1511 to 1523, under the ruling of Kasim Khan, Kazakh Khanate grew significantly.
In the 17th century, Cossacks captured the cities of Oral (Uralsk) and Atyrau (Gur'yev). In 1730, Abul Khayr took the help of Russians against the Kalmyks, thereby allowing the Russians to acquire permanent control of the Lesser Horde. By 1798, the Russians took over the control of the Middle Horde. In 1820, the Khans of the Great Horde, while expanding Kokand Khanate to the south, chose to take Russian protection, thereby making it easier for the Russians to control the Great Horde.
For a brief period, Kazakhstan enjoyed independence during the Alash Autonomy. But this did not last long, and the collapse of the Russian Empire led to Kazakhstan's surrender to Soviet rule. The revolt ok the Kazakh people bore no fruits. Between 1926 to 1939, the country's population reduced by 22% due to various reasons such as mass emigration, starvation, and violence. Kazakhstan's rich cultural background took a back seat; when many poets, writers, politicians, and historians were beheaded on Stalin's order. Population inflow due to mass deportation from Siberia and other Soviet regions led to the formation of large labour camps where they were held under captivity. Kazakh SSR was a vital part of the Soviet Union's share in World War II. In fact, in 1947, two years after the war ended, the nuclear weapon test site was unearthed at Semey, a city in eastern Kazakhstan.
During World War II, Kazakhstan's economy improved with industrialisation and mineral extraction in defence of war purposes. After Stalin's death, things improved when in 1953, Nikita Khrushchev started the 'Virgin Lands' project to convert Kazakhstan's pastures into agricultural lands. The country, which was already dependent heavily on agriculture for sustenance, turned out to be a promising project. Even if the 'Virgin Lands' project brought mixed results, later on, under the rule of Leonid Brezhnev, agricultural production increased.
Tensions between the Soviet rule and Kazakh people were increasing day by day, the primary reason being the nuclear weapon test at Semey in 1949 by Lavrentiy Beria. This disastrous test had a long-lasting biological and ecological effect which was felt generations later, bringing to a boil the anger of Kazakh people towards the Russians. The Jeltoksan riot by young Kazakh's in 1986 against the replacement of Dinmukhamed Konayev in favour of Gennady Kolbin was suppressed by the Soviets. Many protesters were killed, while others were jailed. Even during the declining Soviet rule, protest and discontent continued to grow.
While still being under the rule of the Union of Soviet Socialist Republics, Kazakhstan declared sovereignty in October 1990. After the Soviet Union was dissolved and the Soviet Republic sought its independence, Kazakhstan was the last country to declare it on December 16, 1991.
Nursultan Nazarbayev became Kazakh's president in 1991, the situation improved, and the country's economy started stabilising. Petroleum and mineral reserves found in the 20th century showed the way to considerable economic growth.