The city was notable as a home for immigrants from the Arab lands
as well as for those
from Sogdia
and elsewhere in Central Asia.
In the period
from 813 to 818,
the temporary residency of
the caliph al-Ma'mun
effectively made
Merv
the capital of the Muslim world
and
highlighted Merv's importance to the Abbasids.
Merv
also became the center of a major
8th-century
Neo-Mazdakite movement led by al-Muqanna,
the "Veiled Prophet",
who gained many followers by claiming to be an incarnation of God and heir to Abu Muslim; the Khurramiyya inspired by him persisted
in Merv until the 12th century.
During this period
Merv,
like Samarkand and Bukhara, functioned as
one of the great cities of Muslim scholarship;
the celebrated historian
Yaqut (1179-1229) studied in its libraries.
Merv
produced a number of scholars in various branches of knowledge,
such as
Islamic law, hadith, history, and literature.
Several scholars
have the name
Marwazi
designating them as
hailing from Merv,
including the famous
Ahmad Ibn Hanbal
(780-855).
The city continued to have
a substantial
Christian community.
In 1009
the Archbishop of Merv
sent a letter to the Patriarch at Baghdad
asking that the Keraites be allowed to fast less than other
Nestorian Christians.
As the caliphate weakened,
Arab rule in Merv was replaced by that of the
Persian general Tahir b. al -Husayn and his
Tahirid dynasty in 821.
The Tahirids ruled
Merv
from 821 to 873,
followed by the Saffarids (873-),
then the Samanids
and later the Ghaznavids.
Turks in Merv
In 1037,
the Seljuks,
a clan of
Oghuz Turks
moving from the steppes east of the Aral Sea, peacefully took over
Merv under the leadership of Toghril Beg-the Ghaznavid sultan Masud was extremely unpopular in the city. Togrul's brother Çagry stayed in Merv as the Seljuk domains grew to include the rest of Khurasan and Iran, and it subsequently became a favorite city of the Seljuk leadership. Alp Arslan (Sultan: 1063-1072) and his descendant Sultan Sanjar (died 1157) were both buried at Merv.
During this period
Merv expanded to its greatest size-Arab and Persian geographers termed it
"the mother of the world", the "rendezvous of great and small", the "chief city of Khurasan" and the capital of the eastern Islamic world.
Written sources also attest to a large library and madrasa founded by
Nizam al-Mulk (Vizier: 1064-1092), as well as many other major cultural institutions.
Merv was "the best of the major cities of Iran and Khurasan" (Herrmann 1999).
Sanjar's rule, marked by conflict with the Kara-Khitai and Khwarazmians,
ended
in 1153 when
Turkish Ghuzz nomads from beyond the Amu Darya pillaged the city.
Subsequently,
Merv changed hands between the Khwarazmians of Khiva, the Ghuzz, and the Ghurids -
it began to lose importance relative to Khurasan's other major city,
Nishapur.
Mongols in Merv
In 1221
Merv opened its gates to Tolui, son of Genghis Khan, chief of the Mongols, on which occasion
most of the inhabitants are said to have been butchered.
The Persian historian Juvayni, writing a generation after the destruction of Merv, wrote
"The Mongols
ordered that, apart from four hundred artisans. ..,
the whole population,
including
the women and children,
should be killed, and no one, whether woman or man, be spared.
To each [Mongol soldier] was allotted the execution of three or four hundred Persians.
So many had been killed by nightfall that the mountains became hillocks, and the plain was soaked with the blood of the mighty."
Some historians[who?] believe that
over one million
people died in the aftermath of the city's capture,
including hundreds of thousands of refugees from elsewhere,
making it one of the most bloody captures of a city in world history.
Excavations revealed drastic rebuilding of the city's fortifications in the aftermath, but the prosperity of the city had passed.
The Mongol invasion spelt the eclipse of Merv and indeed of other major centres for more than a century.
After the Mongol conquest,
Merv
became part of the
Ilkhanate
and was consistently looted by
Chagatai Khanate.
In the early part of the 14th century
the town became the seat of a
Christian archbishopric of the Eastern Church
under the rule of the Kartids,
vassals of the Ilkhanids.
By 1380
Merv
belonged to the empire of Timur
(Tamerlane).
Uzbeks in Merv and its final destruction
In 1505
the Uzbeks occupied
Merv;
five years later Shah Ismail, the founder of the Safavid dynasty of Persia, expelled them.
In this period a Persian nobleman restored a large dam (the 'Soltanbent') on the river Murghab, and the settlement which grew up in the area thus irrigated became known as "Ba'yramaly", as referenced in some 19th-century texts.
Merv
remained in the hands of Persia
(except for periods of Uzbek rule between 1524 and 1528 and again between 1588 and 1598) until 1785, when Shah Murad, the Emir of Bokhara, captured the city.
A few years later,
in 1788 and 1789,
the Bukharan Manghit king,
Shah Murad Beg
razed the city to the ground,
broke down the dams,
and converted the district into a waste.
The entire population of the city and the surrounding oasis of
about 100,000
were then
deported in several stages to the Bukharan oasis and Samarkand region in the Zarafshan Valley.