The ruins of Merv are comprised of five walled cities dating from the 6th century BC to the 18th century, known as Erk Kala, Gyaur Kala, Sultan Kala, Abdullah Khan Kala and Bairam Ali Khan Kala, grouped into three settlements corresponding to three periods, the ancient, medieval and post-medieval Merv. What would later become a major medieval city, and whose ruins are now known as the Sultan Kala, initially arose as a suburb beside the Majan canal outside the fortified ancient city (the ruins now known as Gyaur Kala) sometime before the eighth century.
Abbasid Abu Muslim established dynastic power in Merv in February 748 after defeating the Umayyad caliphate and, possibly to mark the change of power, relocated the government and major bazaars from the ancient city to a location beside the canal, near the suburb. Merv prospered at this site under the Abbasids and Tahirids, but went through a period of decline when political power moved to Nishapur and Bukhara.
When the Seljuks arrived in the eleventh century they revived the city, naming it Marw-al-Shahijan, and ushered a period of the city's greatest prestige as an eastern Seljuk capital. Fortification walls were built to enclose the settlement at the end of the eleventh century, possibly by Sultan Malikshah (1072-92). Sultan Sanjar (1118-57) is credited with construction of a fortified citadel, the Shahriyar Ark, in the northeast corner, and the two walled suburbs that extend the city to the north and south.
Sanjar's Mausoleum, located in the center of the Sultan Kala, is the only element of a complex with mosque and palace that has survived. Remains of another palace and a pigeon house still stand within the Shahriyar Ark.
Herrmann, Georgina. 1999. Monuments of Merv: Traditional Buildings of the Karakum. London: The Society of Antiquaries of London.
Nikitin, A. B. and Zeymal, YE. V. 'Merv' in Dictionary of Art vol. 21, 167