Tahirid dynasty
The Umayyad period lasted until 747, when Abu Muslim captured it for the Abbasids (next Sunni Caliphate dynasty) during the Abbasid Revolution. The city remained in Abbasid hands until 821, when it was taken over by the Tahirid dynasty, albeit still in the Abbasids' name. In 870, the Saffarids captured it.