The Spanish–Ottoman wars were fought between the Ottoman Empire and the Spanish Empire for Mediterranean and overseas influence, and especially for global religious dominance between the Catholic Church and the Ottoman Caliphate. The peak of the conflict was in the 16th century, during the reigns of Charles V of the Holy Roman Empire (HRE), Philip II of Spain, and Suleiman the Magnificent of the Ottoman Empire; the conflict occurred during the years 1515–1577, although it formally ended in 1782.
Prelude
Clash of interests in the Mediterranean and Europe
Islamic rule in the Iberian Peninsula, which began in 711, experienced its last great period during the reign of Abd ar-Rahman III (929–961). After his death, the Andalusian Umayyad state began to decline, and with the collapse of this state in 1031, the Tawaif-i Mulûk period—in which various Muslim emirates (34 at one point) ruled together—was between 1031 and 1090. Muslims tried to resist the attacks of the Christian kingdoms in the peninsula (León, Castile, Aragon, Navarre, Galicia and Portugal) within the framework of the goal of the Reconquista during the Almoravid and Almohad periods (1090–1248); however, the Battle of Las Navas de Tolosa in 1212 was a turning point in Islamic history. After a decisive victory by the Christians, the Emirate of Granada continued to exist in areas confined to the south of the peninsula as a dependency of Castile between 1232 and 1492; but with the unification of Castile and Aragon in 1469, the emirate began to face a more aggressive Spanish policy. Having lost its lands one by one in the Granada War that began in 1482, the Emirate of Granada was erased from history when its capital, Granada, fell on 2 January 1492, after an eight-month siege. The relations between the Ottoman Empire and Spain also began indirectly with the Granada War. Emir Abu Abdullah, who was in a difficult situation because of a series of land losses during the war, sent an ambassador to the Ottoman Sultan Bayezid II asking for help. However, Bayezid II was occupied with his brother Cem on the one hand and fighting with the Mamluks on the other, so he could not send the requested help.
The Spanish Empire expanded its military operations to the North African coast and—with the help of its strengthened navy and the leadership of Cardinal Cisneros—settled at Santa Cruz de la Mar Pequeña in 1478. Then it occupied Melilla on the Moroccan coast and the island of Djerba on the Tunisian coast in 1497; Mers El Kebir in 1505; Peñón de Vélez de la Gomera in 1508; Oran in 1509; and Béjaïa and Tripoli in 1510. It also built a fortress on the island opposite the city of Algiers (recently conquered) and took the city indirectly under its control. However, the empire was defeated on Djerba in 1510. Simultaneously, a new phase of Moroccan–Portuguese conflicts started in which the Portuguese conquered the territories of Asilah and Tangier in 1471; conquered Castelo Real in 1506; won Azemmour in 1513; and won the Tednest and the Boulaouane in 1514. However, the empire failed at Graciosa in 1498; at Mamora and Marrakesh in 1515; and at Doukkala in 1516. Corsair raids remained a primary aspect of Ottoman–Spanish conflict. For example, as a modern study notes, the fall of Granada (1492) and Iberian incursions into North Africa "triggered a corsair war", with Ottoman-backed North African rulers licensing raids on Spanish shipping.
This Iberian expansion over North Africa was formalized in 1509: the Crown of Castile and the Crown of Portugal signed the Capitulation of Cintra, in which both kingdoms partitioned the Maghreb into two spheres of influence, in which Morocco and Western Sahara were considered part of the Portuguese Empire's projection of power and territorial expansionism, while Algeria, Tunisia and Libya were part of the Spanish Empire's one. The main objective was to establish cooperation between the Iberian kingdoms for the conquest of North Africa. This was considered a continuation of the Reconquista to avoid further Berber-Islamic interventions in Iberia, as during the Marinid dynasty (legitimizing it by claiming that Mauretania Tingitana was part of Hispanidad/Iberism because of former links with Visigothic and Roman Hispania, along the existent in Al-Andalus era). Therefore it was necessary to avoid a Luso-Castilian war for control of the Berber states. As a result, it was agreed that the Portuguese would abandon the conquest of Vélez de la Gomera and the rest of the eastward territories (ensuring the Castilian sovereignty of Melilla and Cazaza), while the Castilians accepted Portuguese sovereignty over the North African territories between Vélez and Cape Bojador (on the Atlantic coast). Another important goal was the peaceful evangelization of Muslims through vassalage of their rulers.
During this period, all of North Africa (except Egypt) was ruled by local emirates that lacked military power and were too weak to resist the Spanish invasions. Two developments changed this disadvantageous situation in the early 1500s. First, after the prohibition of Islam in Spain in 1502, tens of thousands of Muslims from Andalusia migrated to North Africa, creating a fresh and dynamic population. Second, Turkish sailors from the western Anatolian coasts based themselves in the region and began resistance against the Spanish.
Within this framework, Oruç Reis and Kemal Reis—who were based on the island of Djerba in 1503—carried Muslims and Jews from Spain to North Africa, and they also began to clash with the Spanish. Oruç Reis and Hızır Reis (Hayreddin Barbarosa), who joined him, made an agreement with the Hafsid Ruler of Tunisia, Muhammed El-Mutawakkil IV, and settled in La Goulette in 1504. From then until 1513, and from 1513 onwards, they began to struggle with the Spanish and their allies on land and sea from their new base in Cherchell. However, since they lacked sufficient power to cope with the Spanish Navy, they sent gifts by ship in 1515 to the Ottoman Padishah Sultan Selim I, demonstrating their loyalty; in return, they were granted authority to collect ships and soldiers from the western Anatolian coasts. In this way, fighting began between the Ottoman Empire and the Spanish Empire over Algeria and Tunisia (which later became an all-out war).
Clash of overseas interests and globalization of war
Since both empires coincided in development as great naval powers, they began to carry out large expeditions to increase their diplomatic rank, which involved more regional powers from different territories in the Spanish–Ottoman and Catholic-Islamic conflict—in some ways a world war—over the long-term. Moreover, after Ottoman emperors gained the title of Ottoman caliphs by overwhelming the Abbasid Dynasty after the Ottoman–Mamluk War (1516–1517), they were considered heads of the Dar as-Islam (Muslim world). They had the power to involve the rest of the Sunni Muslim states—particularly the Berber states, the Horn of Africa Sultanates, the Arabian Emirates, the Indian Sultanates, the Malaysian Sultanates, and the Indonesian sultanates affected by Iberian Colonialism—despite already having possession of the Ottoman Balkans, Levant, and Egypt. Also, Habsburg Spain was intimately bound with the Austrian branch of the Habsburg monarchy (the Holy Roman Empire, the Kingdom of Bohemia, and the Kingdom of Hungary-Croatia) and had possession of the Habsburg Netherlands and Italian domains (the Kingdom of Naples, the Kingdom of Sicily, the Kingdom of Sardinia, and the Duchy of Milan). The latter permitted closer ties with the Papal States—a universal power among the res publica Christiana (international community of Christian peoples and states)—and restoring the Gelasian political philosophy of Dominium Mundi to involve all Christendom against the Türkenkriege (Turkish wars) in Europe, as well as starting campaigns for the Catholic Church's potestas (power) over infidel societies outside Europe; this justified a first wave of European colonialism. This made the first stages of the Spanish–Ottoman struggle into a total global war between the Muslim world and Christendom for two purposes: conquest of a universal monarchy (i.e., the Pope and the Holy Roman Emperor against the Ottoman Caliph to be the King of Kings of the Abrahamic world) and suppression of the other "false religion". At the same time, they also sought to evangelize the pagans of Africa and Asia. They had two additional goals: a maximal goal of world domination, along with a minimal goal of being considered the successor to the Roman Empire and having political preponderance in Europe.
The first contacts were made with Safavid Iran via Petrus de Monte Libano (a Maronite ambassador), who developed a report to Shah Ismail I on the political situation in Europe and the greatness of Charles V, King of Spain and Holy Roman Emperor (including comparison with Charlemagne), as well as brother-in-law of King Louis II of Hungary. This information was provided to reach a potential ally for Persia against the Ottomans after the Turkish conquest of Egypt. The Republic of Venice was considered first, but it rejected the offers because of the Persian interest in including the Portuguese Empire (a rival of the Venetians in the spice trade) in the alliance, after Afonso de Albuquerque in Goa established good relations with the Safavids in 1513. Although Spanish envoy to the Mamluk Court, Peter Martyr d'Anghiera, heard about the Persian-Venetian conversations and communicated this to Pedro Fajardo. This communication included stories that the Shah was a powerful sovereign capable of challenging all the princes of the world, generating fascination among Spanish diplomats (who were already interested in Persia since the suggestion by Pope Leo X to Ferdinand II of Aragon of a mutual Catholic-Shia alliance between Portugal, the Castile-Aragon Union, Jagiellonian Hungary and Safavids against the Sunni Ottoman Caliphate). This motivated Spain to send missions to Persia in 1516–1519.
Thus a Habsburg–Persian alliance developed, and the Persians in 1524 proposed to Habsburg Spain the development of a two-front war against the Ottoman Empire, on the condition of not concluding separate peace treaties. In addition, Charles V communicated to the Persians about the French–Habsburg rivalry and the need for Persian support against a possible Franco-Ottoman alliance. However, the subsequent Shah Tahmasp I encountered logistical difficulties in implementing the agreements reached, because of delayed communications (between 7 and 8 years due to technological deficiencies). However, the Persians and the Spanish were de facto allies, and Ottoman war plans always included securing the border with Persia when campaigning against Spain, and vice versa. Even Álvaro de Bazán testified in his chronicles that Suleiman the Magnificent feared a two-front war against Spain and Persia. To support this project, Persians under Qadi Jahan Qazvini reinforced their contacts with the Portuguese, the Venetians, the Mughals, and the Shiite Deccan sultanates. This approach also influenced Portuguese maritime exploration, which brought news of the Turkish-Iranian Wars (with many victories for the Persians until the Battle of Chaldiran) and testimonies about the travels of explorers. These explorers included both foreigners—such as the Italian Ludovico de Varthema—and Spaniards such as Martín Fernández de Figueroa (a Spanish soldier in the Portuguese Empire during his expeditions to the Persian Gulf and India). He published the book Tratado de la conquista de las Islas de Persia y Arabia (Treaty of the conquest of the Islands of Persia and Arabia), edited by Juan Agüero de Trasmiera. Ferdinand Columbus told King Charles I that Spain had the right to conquer Persia.