The Ottoman Empire took nominal control of Tunis in 1534 when Hayreddin Barbarossa captured it from the Hafsid Sultan Mulai Hassan, who fled to the court of Charles V, Holy Roman Emperor and King of Spain. Charles, suffering losses from the corsairs operating out of Djerba, Tunis, and Algiers, agreed to reinstate Mulai Hassan in exchange for his acceptance of Spanish suzerainty. A naval expedition led by Charles himself was dispatched in 1535, and the city was recaptured. The victory against the corsairs is recorded in a tapestry at the Royal Palace of Madrid. The Spanish governor of La Goulette, Luys Peres Varga,  fortified the island of Chikly in the lake of Tunis to strengthen the city's defenses between 1546 and 1550. 