By the early 4th century AD, a Kushan noble from the Balkan province called Malkar of Khi, had become leader of the Huns settled there. In alliance with Dulo the Alan king on the Volga Delta, Malkar went on to forge ten tribes into the first proto-Turkic tribal confederation. The Dulo clan's first proto-Turkic Empire spread its influence as far east as the sub-continent under the Kitolo and as far west as Central Europe under Attila's Dulo. Wresting control of southern Turkmenistan from the Sasanian Empire in the 5th century AD, Malkar's "Dulo" Confederation of Ten Tribes caused a migration of Khurasanis into Dagestan as the Caucasian Avars.
As a result of this backfire, the Sabirs settled there were forced to attack the Alan strongholds of the Dulo Ten Tribe Confederation in the Kuban steppe. To strengthen their position, Malkar's Confederation of Ten Tribes now under the leadership of Ernakh entered into an alliance with Byzantium at Phanagoria
in the 460s AD.
However,
in the 550s AD,
the Caucasian Avars pushed further conquering Phanagoria and forcing Sarosios of the Alans to petition Byzantium for land. Within a few years, Dulo's Ten Tribe Confederation in Balkan Province allied themselves to the Ashinas forming the Western part of the Gokturk Empire and were able to snatch Phanagoria back from the Avars renaming the Sabirs as Khazars under the rule of Kaghan Kazarig.
By exposing the Avars' close ties to Persia, once again the Ten Tribes of the Dulo entered into alliance with Byzantium.
However, the Dulo clans Ten Tribes soon seceded from the Gokturks to become the Western Turkic Kaghanate which thrived
until 630s.
They appointed Dulo Kaghan Kubrat to establish the short-lived state of Old Great Bolgary disintegrating upon his death with the majority migrated west where they carried out
the first
Hungarian conquest
in 677 under Kotrag who also went up the volga to establish Bolgary, and Batbayan's Balkars who settled down with the Circassians north of the Caucasus.
The Kara-khazars in the Balkan Province eventually revolted against the Aq-Khazars to establish the Yabghu Oghuz State of the Kara dynasty which produced the Seljuks who thrived until their dynasty was taken over by Temujin.
At this time much of the population was already in settlements around the fertile river valleys along the Amu Darya,
and
Merv and Nisa
became centers of sericulture (the raising of silkworms).
A busy caravan route, connecting Tang Dynasty China and the city of Baghdad (in modern Iraq), passed through
Merv.
Thus, the city of Merv constituted an important prize for any conqueror.
Arab invasion and Islamization
Central Asia came under Arab control after a series of invasions
in the late 7th and early 8th centuries
and was incorporated into Islamic Caliphate divided between provinces of Mawara'un Nahr and Khorasan.
The Arab conquest brought Islamic religion to all of the peoples of central Asia.
The city of Merv was occupied by lieutenants of the caliph Uthman ibn Affan, and was constituted as the capital of Khorasan. Using this city as their base, the Arabs, led by Qutayba ibn Muslim, brought under subjection Balkh, Bokhara, Fergana and Kashgaria, and penetrated into China as far as the province of Kan-suh
early in the 8th century.
Merv achieved some political spotlight
in February 748
when Abu Muslim (d. 750) declared a new
Abbasid dynasty
at Merv,
and set out from the city to conquer Iran and Iraq and establish a new capital at
Baghdad.
Abu Muslim was famously challenged by the
Goldsmith of Merv
to do the right thing and not make war on fellow Muslims.
The Goldsmith was put to death.
In the latter part of
the 8th century
Merv
became obnoxious to Islam as the centre of heretical propaganda preached by al-Muqanna "The Veiled Prophet of Khorasan". Present Turkmenistan was ruled by Tahirids between 821 and 873. In 873 Arab rule in Central Asia came to an end after Saffarid conquest.
During their dominion
Merv, like Samarkand and Bokhara,
was one of the great schools of learning,
and the celebrated historian
Yaqut
studied in its libraries.
Merv produced a number of scholars in various branches of knowledge,
such as Islamic law, Hadith, history, literature, and the like.
Several scholars have the name:
"Marwazi" designating them as "hailing from Merv".
But Saffarid rule was brief and they were defeated by Samanids in 901.
Samanids weaked after second half of 10th century and Ghaznavids took present Turkmenistan in 990s. But, they challenged with Seljuks, newcomers from north. Seljuks' decisive victory against them, present Turkmenistan was passed to them in 1041.
Oghuz tribes
The origins of the Turkmen may be traced back to the
Oghuz confederation
of nomadic pastoral tribes
of the early Middle Ages,
which lived in present-day Mongolia and around Lake Baikal in present-day southern Siberia.
Known as the Nine Oghuz, this confederation was composed of Turkic-speaking peoples who formed the basis of powerful steppe empires in Inner Asia.
In the second half of the 8th century, components of the Nine Oghuz migrated through Jungaria into Central Asia, and Arabic sources located them under the term Guzz in the area of the middle and lower Syrdariya in the 8th century.
By the 10th century, the Oghuz had expanded west and north of the Aral Sea and into the steppe of present-day Kazakhstan, absorbing not only Iranians but also Turks from the Kipchak and Karluk ethnolinguistic groups.
In the 11th century, the renowned Muslim Turk scholar Mahmud al-Kashgari described the language of the Oghuz and Turkmen as distinct from that of other Turks and identified twenty-two Oghuz clans or sub-tribes, some of which appear in later Turkmen genealogies and legends as the core of the early Turkmen.
First mention of Oghuz goes back to the time prior to the Göktürk state- there are references to the Sekiz-Oghuz ("eight-Oghuz") and the Dokuz-Oghuz ("nine-Oghuz") union.
The Oghuz Turks under Sekiz-Oghuz and the Dokuz-Oghuz state formations ruled different areas in the vicinity of the Altay Mountains.
During the establishment of the Göktürk state, Oghuz tribes inhabited the Altay mountain region and also lived along the Tula River. They also formed as a community near the Barlik river in present-day northern Mongolia.