The effects of Ottoman expansion were felt as far west as Spain in the early sixteenth century. To reduce the possibility that Granadan Moriscos would receive help from Muslims in north Africa, King Ferdinand seized five coastal settlements, including Tripoli and Algiers, and secured Spain’s sea routes between Sicily, Sardinia and Tunisia. However, the creation of a powerful Turkish fleet enabled it to conquer Egypt and renewed the threat to Spain’s possessions. And the situation became critical when Barbarossa defected to the Ottoman fleet: Tunis and Algiers were lost and several north African settlements seized in the 1550s. Not only were Spanish communications with Milan, Naples and Sicily endangered but the mainland towns of Málaga, Cadiz and Gibraltar also suffered raids from corsair pirates. It was just as well that the main Ottoman army was pre-occupied with Persia.
Philip II of Spain responded to the Muslim threat in 1560 when his troops occupied the island of Djerba preparatory to an attack on Tripoli, but the expedition ended in disaster: 27 galleys were lost and 10,000 men were taken prisoner to Istanbul. The recovery of Peñón in 1564 renewed Spanish spirits but celebrations were curtailed with the news that Malta was being besieged by 40,000 troops and 180 Ottoman warships. The subsequent relief of the island in September 1565 by the viceroy of Naples saved Sicily as well as Malta and marked the limit of Ottoman expansion in the western Mediterranean but, in spite of Suleiman’s death the following year, its maritime power remained formidable. In 1570, Tunis, recovered by Spain in 1535, was again captured by the Turks and the Venetian island of Cyprus was attacked.
A Christian fleet, which was mainly Venetian but commanded by a Spaniard, Don John, met the Ottomans at Lepanto in the Gulf of Corinth. The ensuing battle (October 1571) saw two of the largest navies ever assembled and resulted in victory for the Christians. Though they lost 10 of their 208 galleys and 15,000 men, this was nothing compared with the losses sustained by the Turks. 117 out of 270 Ottoman ships were captured, 113 sunk and 30,000 men killed. It was their worst defeat since 1402 and dispelled the myth of invincibility. Most historians have viewed Lepanto as a crucial battle, that ended the long conflict between Muslims and Christians. Thomas Arnold has recently argued that: ‘After Lepanto, the Ottoman navy never recovered its earlier near-mastery of the Mediterranean’. The extant evidence in the Turkish archives, however, does not bear out this judgement, at least not in the short term. The sultan’s reaction to defeat was to rebuild his fleet and double his resolve to control north Africa and the sea routes via Malta and Sicily. Just six months after Lepanto, the Turks had built 200 new galleys and captured Cyprus – a reminder that their potential to inflict a serious blow was still formidable. In 1574 a massive Turkish fleet seized Tunis and put the Spanish garrison in La Goletta to flight. Yet just when it seemed that the Ottomans were resuming the initiative, Selim died, and with him passed the last competent sultan for over a hundred years. Western Europe had been saved by a hair’s breadth.
The expansion of the Ottoman Empire had two further direct effects upon Spanish affairs. For 20 years after Philip II’s accession (in 1556), the problem had drawn resources away from the Netherlands and northern Europe and enabled the Dutch Revolt to gather momentum. Second, there was widespread belief in the 1560s that the Spanish Moriscos were in secret contact with the Muslims and the Ottoman court in Istanbul. Though some 4,000 Turkish and Berber troops fought alongside the Granadan Moriscos in their rebellion of 1568-70, letters from local Turkish rulers in 1574 suggest that the sultan was indeed contemplating a co-ordinated attack on Spanish lands. Philip II and the Inquisition continued to investigate reports of collusion. Though nothing was proved, it served to perpetuate the myth of the ‘Turkish menace’ and add fuel to the Inquisition.