The invasion of Algiers was a massive and disastrous amphibious attempt in July 1775 by a combined Spanish and Tuscan force to capture the city of Algiers, the capital of The Deylik of Algeria. The amphibious assault was led by Spanish general Alexander O'Reilly and Tuscan admiral Sir John Acton, commanding a total of 20,000 men along with 74 warships of various sizes and 230 transport ships carrying the troops for the invasion. The defending Algerian forces were led by Baba Mohammed ben-Osman. The assault was ordered by the King of Spain, Charles III, who was attempting to demonstrate to the Barbary States the power of the revitalized Spanish military after the disastrous Spanish experience in the Seven Years' War. The assault was also meant to demonstrate that Spain would defend its North African exclaves against any Ottoman or Moroccan encroachment, and reduce the influence that the Barbary states held in the Mediterranean.