The history of Turkmenistan in the Middle Ages begins with the invasion of the Arabs in Central Asia. In the VIII. In the VIII century the Arabs defeated the Sassanid Empire and brought Islam to the territory of Turkmenistan. In 776-783 the population took part in the uprising against the Arabs led by Hurramit Hashim ibn Hakim (Muqanna). In the 9th century the Arab rule in Turkmenistan ended and was revived by the Tahirids and Samanids.
The Ghaznavids, who in the X. Century, ended the rule of the Samanids and began their own era. The Oghuz-Turkmen movement in the XI-XII. Centuries led to the formation of a great empire, which spread from Central Asia to Syria and Palestine and was led by the Seljuk dynasty.
The Seljuk sultans paid great attention to science, art and construction. The most magnificent building of the Seljuk period is undoubtedly the Mausoleum of Sultan Sanjar in Merv, created by the brilliant architect Muhammad ibn Atsiz of Serakhs. The synthesis of the traditions of ancient architectural planning with the rich ornamentation of the Oguz tribes in the Seljuk period produced magnificent architectural creations, most of which have been preserved to this day. They are the invaluable historical and cultural heritage of the Turkmen nation.
In the XII century the Turkmen living on the territory of Turkmenistan fell under the rule of the Khorezmshahs: in 1141 Ala ad-Din plundered Atsyz Merv and in 1193 Ala ad-Din annexed Tekeş finally the territories of Turkmenistan to Khorezm. At that time, the Turkmen who had moved to the West already had their own state association, the Sultanate of Konya, whose territory became the core of the education of the Turkish people.
During the rule of Sultan Zhaloliddin Khorezmshah, the Khorezmshahs conquered Iran, Iraq, all of Central Asia and Northern India. Their dynasty began to dominate the great state in the East. They built a civilisation that was superior to their contemporaries in culture, art and architecture.
The Ma’mun Academy in Gurgandja was one of the largest scientific centres at that time. Famous scientists studied at this scientific institute, such as Al-Khorazmiy, Al-Samani, Abu Ali ib Sina (Avicenna), who invented over 700 drugs in the pharmaceutical world history, the great mathematician Abu Rayhan Al-Beruni and others. The strong armies of the Mongols took advantage of the external and internal unrest in Khorezm and launched an attack at the end of 1219.
At the beginning of 1219, the territory of Turkmenistan, which was under the control of Khorezm, was devastated by the Mongol invasion. The cities of Merv and Urgench were turned into ruins. Some sources claim that about one million people were killed by Mongols during this war. Mongolian invasions have greatly changed the economic and cultural life of Turkmenistan and Khorezm. Libraries, dams, mosques and scientific institutions were destroyed, and hundreds and thousands of people were ruthlessly executed.
After the fall of the Mongol Empire due to internal unrest, Amir Timur (Tamerlan) brought the Turkish tribes together and formed a powerful state, restoring stability in Turkestan. This was the golden age of the history of Turkmenistan in the Middle Ages.
After conquering Khorezm and most of Turkmenistan in 1388, Amir Timur (Tamerlan), who extinguished the Golden Horde, extended the territory of his rule northwards. During the Mongol period and the reign of Amir Timur (Tamerlan), many Turkmen tribes such as Teke, Salur, Yamut and Yersaru moved from Turkmenistan to Iran, Iraq, the Caucasus and Turkey. And such tribes as the Turkmen Akkoyunlu (white sheep) and Karakoyunlu (black sheep), who founded states in western and northern Iran and in eastern Anatolia, established a great civilization between the XIII and XVI centuries. According to historical sources, Bairam Khan, who gained a good reputation during his campaign to India, was a native Turkman of the Karakoyunlu.
When the Uzbek Khan Shaibani-khan, who replaced Amir Timur (Tamerlan), was defeated by Shah Ismail in Merv in 1510, Turkmenistan was conquered by Safavids, but the Turkmen who lived in Khorezm and united with the Uzbeks did not allow Safavids to expand in the region for a long time.