It was not until the early Abbasid period that Tarsus, by then lying in ruins, was once more reoccupied and refortified, this time as an advanced strongpoint within the fortified zone of the "al-ʿAwāṣim", stretching from Tarsus northeast to Malatya, and as an assembly centre for expeditions against the Byzantine Empire. The first attempt was undertaken by al-Hasan ibn Qahtaba al-Ta'i in 778/9, but it was apparently unsuccessful, and the city was not fully restored until 787/8, by Abu Sulaym Faraj on the orders of Caliph Harun al-Rashid (). 3,000 Khurasanis and 2,000 Syrians (a thousand each from Antioch and al-Massisa) were given houses and land in the new fortress city. Tarsus was apparently recovered by the Byzantines soon after, at some point at the turn of the century. The city probably remained in Byzantine hands during the Abbasid civil war of the Fourth Fitna, but returned to Muslim control by 830, when Caliph al-Ma'mun () recommenced offensive campaigns against Byzantium, using the city as a base.