of Merv sent a letter to the Patriarch at Baghdad asking that the Keraites be allowed to fast less than other Nestorian Christians. Great Persian polymath Omar Khayyam, among others, spent several years working at the observatory in Merv. As Persian geographer and traveller al-Istakhri wrote of Merv: "Of all the countries of Iran, these people were noted for their talents and education." Yaqut al-Hamawi counted as many as 10 giant libraries in Merv, including one within a major mosque that contained 12,000 volumes. As the caliphate weakened, Persian general Tahir b. al -Husayn and his Tahirid dynasty replaced Arab rule in Merv 821. The Tahirids ruled Merv from 821 to 873, followed by the Saffarids, then the Samanids and later the Ghaznavids. Turkmens in Merv In 1037, the Seljuq Turkmens, a clan of Oghuz Turks moving from the steppes east of the Aral Sea, peacefully took over Merv under the leadership of Tughril—the Ghaznavid sultan Mas'ud I was extremely unpopular in the city. Tugril's brother Chaghri stayed in Merv as the Seljuq domains grew to include the rest of Khurasan and Iran, and it subsequently became a favourite city of the Seljuq sultans. Chaghri, his son Alp Arslan (sultan from 1063 to 1072) and great-grandson Ahmad Sanjar (sultan from 1118 to 1157) were buried at Merv, the latter at the Tomb of Ahmad Sanjar. Nearing the end of the 11th century, Merv became the eastern capital of the split Seljuq state. However, starting from 1118, it served as the capital of the whole empire. 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 of the Seljuq empire, as well as many other major cultural institutions. Perhaps most importantly, Merv had a market described as "the best of the major cities of Iran and Khurasan". Sanjar's rule, marked by conflict with the Kara-Khitai and Khwarazmians, ended in 1153 when Turkmen nomads from beyond the Amu Darya pillaged the city. Subsequently, Merv changed hands between the Khwarazmians of Khiva, Turkmen nomads, and the Ghurids. According to Tertius Chandler, by 1150 Merv was the world's largest city, with a population of 200,000. By 1210, it may have had