As a result of the fight with the Karluks in the middle of the 8th century for the leadership in the Turgesh Khaganate, a significant part of Oghuz tribes left Zhetysu (Semirechye) and moved to the foothills of the Karatau Mountains and the valley of the Chu River. Here was their residence, called "Old Guziya." At the beginning of the 9th century the Oghuz leaders in alliance with the Karluks and Kimeks defeated the Kangar and Pecheneg tribes and captured the lower reaches of the Syr Darya and Aral Sea steppes. At the end of the 9th century in alliance with the Khazars they defeated the Pechenegs and captured the area between the Ural and the Volga.
A long period of struggle with the Pechenegs led to political consolidation and formation of the Oghuz tribal alliance in the 9-10th centuries. The ancient (mostly Turkified) ethnic groups of Indo-European and Finno-Ugric origin from the Syr Darya valley and the Aral-Caspian steppes, as well as semi-nomadic and nomadic clans and tribes of Zhetysu and Siberia became the part of the Oghuz tribal alliance. There were the Khalajes, Dzhagras, Charuks, Karluks, Imurs and Bayandurs. Formation of the Oghuz ethnic community was a complex and long process. Initially, the nucleus of the Oghuz tribes formed in Zhetysu, but after their movement to the west it included the nomadic and semi-settled population of the South and West Kazakhstan.
The Oghuz alliance was divided into a number of tribes with a variety of divisions. According to Mahmud of Kashgar (11th c.) they initially consisted of 24 tribes, of which 12 tribes were Buzuks, and 12 tribes were Uchuks. The Buzuks enjoyed many privileges. The Oghuz Turks had close contacts with neighboring Turkic tribes and nations - Karluks, Pechenegs, Bashkirs, Kimeks and Kipchaks.
In the late 9th – early 11th centuries the Oghuz tribes lived on the vast territory from the middle reaches of the Syr Darya to the lower reaches of the Volga. The Oghuz pastures were located on the Irgiz, Ural, Emba, Uil rivers, in the foothills of the Karatau Mountains and on the territory up to Isfijab. Mostly they lived in the middle and lower reaches of the Syr Darya, in the Aral Sea and the eastern Caspian Sea regions. The Oghuz encampments and fortresses reached the Southern Urals and the Lower Volga region. The Oghuz Turks bordered on settled agricultural areas, Khwarezm, Transoxiana and Khorasan. In the 10th century the vast territory, included the steppes west to the Khazars and the steppes of the northern Caspian region, Central steppes, south-east Karakum Desert and the Aral Kyzyl Kum, called the Oghuz steppe.
The first mention of the Oghuz state appeared in Arabic historical and geographic writings dating from the 9th - early 10th centuries. One of the earliest news of the Oghuz state existence appeared in the historical work of al-Ya’qubi (9th century). It is important because it also has a mention of their wars with the neighboring Turkic tribes: Karluks, Toguz - Oghuz and Kimeks. The geographical work of Ibn al-Faqih (10th c.) contains interesting facts about the Oghuz tribes of the 9-10th centuries, where it is reported that the Oghuzes along with the Kimeks and Toguz Oghuzes were the "kings" (Maliks), and were revered among the Turks.
In the 10th century the capital of the Oghuz state was in Yangikent, located on the important caravan route led to Eastern Europe and Central Asia. The head of the Oghuz state was a supreme ruler, which had the title of "Djabgu." The Oghuz Djabgu was assisted by regional rulers titled Kul-Erkin. The power of the supreme rulers was hereditary. Elections of the Oghuz Khans conducted at the tribal assemblies. An important role played a head of the army called "Subashi."
In the Oghuz state of the 9-10th centuries, patriarchal and feudal relations were developing. The existence of tax collection in the late 10th – early 11th centuries in the Syr Darya Djabgu state suggests that there was an administrative apparatus.
In the Oghuz society private property was developed. There was an intensive process of rising of the rich nobility. The basis of inequality was the private ownership of livestock. Apart from the rich aristocracy there were masses of commoners, paupers and slaves. The main occupation of the Oghuz peoples was extensive livestock raising.
Along with the nomads there were compact groups of semi-settled and settled population. Medieval writers of the 10-11th centuries mentioned such cities and settlements as Jend, Sauran, Karnak, Syutkent, Farab, Sygnak and others. The nomads devoid of livestock had to live a settled way of life. Their main occupation was farming and trading. The Oghuz nomadic steppe had close contacts with the agricultural oases of Transoxiana, Khwarezm and Semirechye. Slave trade was widely spread in the steppe and the sedentary agricultural zone. In the 9th century the rulers of Khorasan annually sent to the court of the Baghdad Caliphs two thousand Oghuz slaves. Originally, the Oghuz Turks were pagans worshiping the shamans. Islam had a spread amongst the Oghuz population.
The Oghuz state played an important role in the political and military history of Eurasia. In 965, in alliance with the Kievan Rus’ they defeated the Khazar Khanate, which eastern boundaries in the middle of the 10th century reached the north- eastern coast of the Caspian Sea. In 985, the Oghuz Djagbu with Russian princes defeated Volga Bulgaria. All this led to the growth of the political power of the Oghuz state.
At the turn of the 10 - 11th centuries the Oghuz state experienced a crisis due to the uprisings of the Oghuz tribes discontented with excessive taxation. According to the Oghuz historical legends, these uprisings were under the rule of Ali Khan, who came to power at the middle of the 10th century. The upheaval was used by the Seljuk leaders, settled near Jend in the middle of the 10th century. The Seljuk leaders led the revolt against the Oghuz rulers of Yangikent and took Jend, but not for long. Soon, they were forced to leave the Jend area.
At this time, Ali Khan’ successor Shahmalik rose to prominence. Under his reign the state was consolidated, and in 1041 the Oghuz army conquered Khwarezm. However, two years later Shahmalik, the last Oghuz Djabgu, was captured by the Seljuks and executed.
Many years of strife and wars with the Seljuks weakened the Oghuz Djabgu state. The weakened state finally fell under the onslaught of the Kipchak tribes. A large part of the Oghuz tribes under the pressure of the Kipchaks went into East Europe and Asia Minor. Another part of the Oghuz tribes fell under the rule of Kara Khanids of Transoxiana and the Seljuk rulers of Khorasan. The remnants of those Oghuz tribes defeated by the Kipchaks in mid-11th century subsequently dissolved among the Turkic-speaking tribes of Dasht-i Kipchak. The Oghuz tribes of the Syr Darya, Aral Sea and the North Caspian regions left a noticeable mark in the history of ethnic Kazakhs.