The capture of Mahdia was an amphibious military operation that took place from June to September, 1550, during the struggle between the Ottoman Empire and the Spanish Habsburgs for the control of the Mediterranean. A Spanish naval expedition under the command of the Genoese condottiero and admiral Andrea Doria and the Spaniard Bernardino de Mendoza, supported by the Knights of Malta under their Grand Master Claude de la Sengle, besieged and captured the Ottoman stronghold of Mahdia or Mahdiye, defended by the Ottoman Admiral Turgut Reis, known as Dragut, who was using the place as a base for his piratical activities throughout the Spanish and Italian coasts. Mahdia was abandoned by Spain three years later, and all its fortifications were demolished to avoid a re-occupation of the city by the Ottomans.
Background
In 1550 the Hafsid kingdom of Tunis, which stretched from the east of modern Algeria to the west of modern Libya, was mired in anarchy, ruled by a council of chieftains that fought each other and none of whom recognized the authority of the Sultan of Tunis, Abu al-Abbas Ahmad III, who had deposed and blinded his father Hasan, a protégé of the Emperor Charles V. In the spring of 1550, taking advantage of the situation, the Ottoman admiral Turgut Reis, with the aid of one of the local leaders, took control of the coastal town of Mahdia, located atop a rock advanced into the sea and defended by two circles of walls with towers and a citadel encircled by a moat.
In 1546, Turgut Reis, also known as Dragut, had organized a fleet of 25 brigantines and harassed the Calabrian and Neapolitan coasts as part of a campaign that culminated in the capture of Mahdia. Fearing that the town would become a base for the Barbary corsairs, which threatened the Christian shipping in the Western Mediterranean, the Holy Roman Emperor Charles V, supported by the Papacy and the Knights of Malta, decided to organize an expedition to capture the city. The command of the enterprise was entrusted to the Genoese admiral Andrea Doria and to Bernardino de Mendoza, Captain General of the galleys of Spain. They led a fleet of 52 galleys and 28 naos which carried on board an army led by Captain General Juan de la Vega, Viceroy of Sicily, and siege weapons and supplies provided by de la Vega himself and the Viceroy of Naples.
Expedition
Siege
The Spanish fleet set sail to Mahdia on 24 June and arrived there four days later. The city was defended by the nephew of Turgut Reis, Hesar, who had spent two months locking cattle and storing rice and beans enough to feed the city for a year, in anticipation of being under siege. The landing of the Spanish troops took place under the protection of the galleys' cannons and out of Mahdia's gun reach. Within hours the Ottoman infantry and cavalry were driven out of a hill they occupied, and to the next day the city was completely surrounded by trenches dug six hundred meters from the walls. Luis Pérez de Vargas, mayor of the castle of La Goulette, who was in command of the Spanish artillery, ordered to install several heavy pieces on the hill occupied the previous day to cover the locations of the 18 lighter pieces that had detached to beat the walls. The same day the first assault was launched, but it was repelled because the moat had not been filled. Despite advancing the artillery close to the walls and improving the trenches, the besiegers, harassed continuously by sallies of the Ottoman garrison, did not make significant progresses in the following days.
Ottoman relief
Turgut Reis received news of the siege while he was plundering the coast of Valencia. After being repelled by the inhabitants of Alzira, Sueca, and other villages, the Ottoman admiral sailed along the Barbary Coast calling for help and money to pay an army to relief Mahdia. The Bey of Tunis and the chieftain of Caruan refused to help him, but he managed to assemble a force composed of 3,700 Moors, 800 Turks, and 60 sipahis, which his fleet disembarked near Mahdia under cover of night. He also sent a man who swam through the Spanish blockade and entered into Mahdia to inform his nephew Hesar.
At dawn on 25 July, Turgut Reis's troops, hidden in an olive grove, attacked the Spanish along with Mahdia's garrison, which made an unexpected sallie. They managed to penetrate the trenches and the besieging camp, but the Spanish troops, with artillery support from the galleys, decimated and forced them back into Mahdia's walls. Turgut Reis took refuge in his galleys and retired to Djerba. Despite the victory, the Christian losses were high. Among the dead was the commander of the Spanish artillery, Luis Pérez de Vargas.