Hafsid dynasty
Tunis had initially been conquered by the Ottomans under Hayreddin Barbarossa in 1534. In the next year, however, Holy Roman Emperor Charles V had launched a major expedition and captured it in turn. He established a garrison and a vassal ruler in the person of Lhacène of the Hafsid dynasty. The Bey of Algiers Uluj Ali Pasha captured Tunis in 1569 for the Ottoman Empire, but in the aftermath of the 1571 Christian victory at the Battle of Lepanto, John of Austria managed to take Tunis in October 1573.