Once insignificant, Tunis (ancient Tynes) features on 5th-century BC maps, and the Roman general Regulus camped here in 255 Be during the First Punic War.
The Carthaginians and the Romans ruled from Byrsa Hill, on the coast to the east, but after ousting the Byzantines in AD 695, the victorious Arab Hassan bin Nooman decided to build at Tunis, which he felt was in a better defensive position. The medina was sited on a narrow band of high ground flanked by the Sebkhet Sejoumi (a salt lake) to the southwest and Lake Tunis to the east. A deep-water channel was dug across the lake to access the sea.
The city was born with the building of the Zaytouna (Great) Mosque in AD 732, but it was in the 9th century, when Aghlabid ruler Ibrahim ibn Ahmed II moved his court here, that it became the seat of power.
Tunis declined under the Fatimids, who chose Mahdia as their capital in the 10th century, and escaped the ravages of the llth-century Hilalian invasion, emerging again as capital following the Almohad North African conquest in 1160.
The city flourished and trade boomed under the Hafsids, who ruled from 1229 to 1574. The population more than tripled (to about 60,000). Souqs (markets), mosques, medersas (Quranic schools) and the Zaytouna Mosque University were established.
Tunis suffered badly during TurkishSpanish tussles, leading to the fall of the Hafsids. Much of the city was destroyed and the population fled. Sinan Pasha finally secured the city for the Ottomans in 1574, and
people began to return, including refugees fleeing religious persecution: Moorish Andalusians from Spain and Jews from Livorno in Italy. Many were fine artisans who played an important role in the city's reconstruction.
In the 19th century, the colonising French built their elegant Ville Nouvelle (new town) on land reclaimed from Lake Tunis, moving the city's focus and causing the medina to decline.