Since the sixth century, Turkmens formed a group of Turkish tribes who gathered under the administration of the Göktürks, and formed Nine-Oghuz khanates in the Tula-Selenga rivers. The Göktürk Khanate; After the establishment of the second time in 682 by Kutluğ, the Göktürks marched on the Turkmens, who did not accept their sovereignty. The Turkmen were defeated in the battle on the banks of the Tula River. However, they did not accept the dominance of the Göktürks. İlteriş Kağan organized many more expeditions on the Turkmens and killed Baz Khan. The center of the Turkmens took over Ötüken and its surroundings. In the face of this defeat, the Turkmens who were obliged to accept the dominance of Ilkeris Khan, participated in the Kyrgyz Campaign of the Göktürks. Later, the Turkmen who rebelled against the Gokturk migrated to the Chinese sides when they were defeated in many wars. After a while they returned to their homeland. They helped the Uighurs to destroy the Göktürk. The Turkmens became one of the main characteristics of the Uighur State. But from time to time they did not stop the rebellion against Uighurs. After the fall of the Uighurs, they migrated to the west and settled on the shores of Sir Derya (Seyhun) and the steppes to the north.
Since the tenth century, the Turkmens also started to live a life with their nomadic lives. At the beginning of this century, the Oghuzes settled around Maveraünnehr and established a state ruled by the rulers called Yabgu. At this time the capital of the Turkmens was the New City on the shore of Sir Derya. Turkmen were divided into two as Üçok and Bozok during the time of the Yabgu State.
At the end of the tenth century, the Turkmen became stronger by accepting the religion of Islam and they defeated them by fighting their neighbors Pechenegs and Khazars. The Turkmens, who accepted the religion of Islam and entered the Seljuk rule, emigrated to Horasan, the realm of Islam, fearing that the ruler of Oguz Yabgu would do evil to them. The other Turkmen tribes in Maveraünnehr were dispersed as a result of the attacks and pressures of the Kipchaks and the Turkmen State was destroyed. The Oguz Turks, who were in their places, settled in Mankışlak and on the banks of the Sir Derya River in the Karacuk Mountains. Then they were subject to the Seljuks as a result of the pressure of the Karahıtayların and Karluks.
Many Turkmens came to life in the Seljuk period. From the second half of the eleventh century, the influx flocked to Iran, Iraq, Anatolia and Syria. Where they went, they did the defense of righteousness, justice, science and civilization. Many mosques, madrasas, caravansaries, baths and bridges were built to serve people, to ensure the spread of science and civilization.
Mankışlak and the Turkmens who lived on the shores of the Sir Derya River lived a more comfortable and independent life from the absence of the latter over the ways of military invasion until the middle of the seventeenth century. However, in 1639 and 1700, they were attacked by the Mongol-origin Kalmuks who caused the Central Asian invasion of Russia, especially with the coup against Kazak. Teke Turkmens, the largest and the strongest of the Turkmen tribes living in the Mankışlak region, retreated to the Kopet Mountain region. There, they joined with the other Turkmen tribes. These Turkmen tribes have been taxed to the Khanate of Hive, which is maintained by the Turkmen-Uzbek cooperation. Afşar Turkmen chief Nadir Shah, who took control of Iran, accepted his rule in the periods where he occupied the Central Asian khanates.
After Nadir Shah, the Turkmens, who had been subjected to the repression and attacks of Iran and Hive Khanate for a while, began to spread to Merv region from 1835 onwards. After that, Iran and Hive Khanates began to attack the Turkmen again. In 1855, the Turkmens attacked the Hive with a heavy defeat, and they escaped the Hive Khanate attacks. However, the Iranian attacks on Turkmenistan left them in a difficult position. Hasan Mirzan, who is sure that he will win the war in the face of the Turkmens who want peace, began to advance in the Turkmen lands with 33,000 army of 30,000. At the same time, the Turkmen of Kushidid Khan, asked for help from other Turkmen tribes and retired to Karakum Desert to save time. Khurshid Khan gathered forces and cut the supply routes, the Iranian army was a great defeat. Thus, the Turkmen literally gained their independence. Hurşid Khan, working for the welfare of his people, made the Turkmen lands an exclusive with the dams and canals he established.
After a heavy defeat, Iran did not attack the Turkmen territory for a while and did not succeed in subsequent attacks. In the period when the Russians accelerated their invasions towards Central Asia, the attacks of the Iranians caused the Turkmen great damage.