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 as a result of the 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. The Samanid dynasty weakened 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.