It continued to be a place of much importance throughout the Abbasid period. Caliph Harun al-Rashid () stayed at the town in 799 and in 803. The town's prosperity was founded on agricultural activities, but also on trade between Iraq and Syria. The town was still prosperous in the early 9th century, but the decline of Abbasid authority during the later 9th century exposed it to Bedouin attacks in 882 and 899. In 927, the Qarmatians under Abu Tahir al-Jannabi sacked the city, and the devastation was compounded by another Bedouin attack two years later. The town's decline accelerated after that: while the early 10th-century geographer Istakhri still calls the town modest but populous, with the ruins of the buildings of as-Saffah still visible, Ibn Hawqal and al-Maqdisi, who wrote a generation later, attest to its decline, and the diminution of its population.