The people of this region are of Mongol and Turkic origin who presence in Kazakhstan dates back thousands of years. Islam came to the area between the 7th and 9th centuries and the Mongols held sway from the early 13th through the mid-15th centuries. At this point the Kazakhs were recognized as a distinct entity but eventually infighting resulted in a tri-part split into the larger, Middle, and Lesser Hordes. When the Mongols again invaded in the mid-1600s, the Kazakhs turned to Russia for protection; a century later, Russia completely dominated the Kazakh lands.
The situation worsened after 1861 when Russian and Ukrainian peasants flowed into Kazakhstan after the freeing of the serfs and were given Kazakh lands. (This influx of Russians and Ukrainians was not limited to this period -- it continued throughout the first seven decades of the 20th century as well such that by 1979, there were more Russians than native Kazakhs in the region.) Simmering resentments led to a major rebellion in 1916. In suppressing the uprising, the Russians killed thousands. The Communist revolution the next year plunged Kazakhstan into civil war. Defeated, Kazakhstan became part of Russia as an autonomous entity, eventually attaining the status of one of the Soviet Union's republics (1936). Independence was declared in 1991 and Kazakhstan became a member of the Commonwealth of Independent States that year. Non-Muslim ethnic minorities departed Kazakhstan in large numbers from the mid-1990s through the mid-2000s and a national program has repatriated about a million ethnic Kazakhs (from Uzbekistan, Tajikistan, Mongolia, and the Xinjiang region of China) back to Kazakhstan. As a result of this shift, the ethnic Kazakh share of the population now exceeds two-thirds.