Tunis Annexed by Ottomans
Tunis, strategically placed on the North African coast, was contested in the sixteenth century between the Ottoman Empire, expanding westward through its corsair allies, and the Spanish Habsburgs under Emperor Charles V, who sought to check Ottoman power in the Mediterranean and protect the local Hafsid dynasty as a client.
Control of the city changed hands several times. After Spanish and allied forces took Tunis in 1573, an Ottoman army under the command of Sinan Pasha recaptured the city the following year, in 1574, and the territory was annexed to the Ottoman Empire.
With this conquest the centuries-old Hafsid dynasty was finally extinguished and Tunisia became an Ottoman province governed from Tunis. Over time real authority passed to local rulers, and in the late seventeenth century the Husainid dynasty of beys established a hereditary regency that, while acknowledging Ottoman suzerainty, governed Tunisia with growing autonomy until the French protectorate of 1881.