This decision infuriated the Shi'ite caliph Al-Mustansir Billah.To punish the Zirids, he unleashed the Banu Hilal Arab tribe on Ifriqiya; a large part of the country was set to the torch, the Zirid capital Kairouan was razed in 1057, and only a few coastal towns, including Tunis and Mahdia, escaped destruction.Some scholars claim that it originated from Tynes, which was mentioned by Diodorus Siculus and Polybius in the course of descriptions of a location resembling present-day Al-Kasbah; Tunis's old Berber Bourgade.
Having previously played a minor role behind Kairouan and Mahdia, Tunis was promoted to the rank of provincial capital.
In 1228, Governor Abu Zakariya seized power and, a year later, took the title of Emir and founded the Hafsid dynasty.
Early on, Tunis played a military role; the Arabs recognized the strategic importance of its proximity to the Strait of Sicily.
From the beginning of the 8th century Tunis was the chef-lieu of the area: it became the Arabs' naval base in the western Mediterranean Sea, and took on considerable military importance.
which can be pronounced as "Tūnus", "Tūnas", or "Tūnis".
All three variations were mentioned by the Greek-Syrian geographer al-Rumi Yaqout in his Mu'jam al-Bûldan (Dictionary of Countries).The city became the capital of a Hafsid kingdom stretching towards Tripoli and Fez.Walls were built to protect the emerging principal town of the kingdom, surrounding the medina, the kasbah and the new suburbs of Tunis.This small independent kingdom picked up the threads of trade and commerce with other nations, and brought the region back to peace and prosperity.The Almohad conquest marked the beginning of the dominance of the city in Tunisia.but the city benefited from economic improvements and quickly became the second most important in the kingdom.