
Themilitary history ofSpain, from the period of theCarthaginian conquests over thePhoenicians to the formerAfghan War spans a period of more than 2200 years, and includes the history of battles fought in the territory ofmodern Spain, as well as her former and currentoverseas possessions and territories, and the military history of the people of Spain, regardless of geography.
Spain'searly military history emerged from her location on the western fringes of theMediterranean, a base for attacks betweenRome andCarthage. With the fall of theRoman Empire, Spain was devastated by successive barbarian invasions, with stability only gradually appearing with the later years of theVisigothic kingdom. The earlyMiddle Ages for Spain saw the country forming the front line in a battle between Christian and Islamic forces in the Mediterranean; theConquista andReconquista took centuries to reach a military resolution. The period from 1492, when the Reconquista was completed and theSpanish colonization of the Americas began, to the late 17th century is known as theSpanish Golden Age. Spain acquired a vastempire by defeating the centralised states of the Americas, andcolonising the Philippines. Hertercio units, backed by imperial gold and silver, were involved in most of the major wars of the period. It was not until the years after theThirty Years' War that Spanish military power began to fade; even then, supported by a reinvigoratednavy, Spain remained a major military power throughout the 18th century, in competition with Britain and France on the global stage.
TheNapoleonic Wars changed Spanish military history dramatically; thePeninsular War saw the development ofguerrilla warfare against the occupying French forces. The collapse of central Spanish authority resulted in successfulwars of independence amongst Spain's American colonies, drastically reducing the size of her empire, and in turn led to a sequence ofcivil wars in Spain itself, many fought by frustrated veterans of the French and colonial campaigns. Attempts to reassert imperial power during the mid-19th century, enabled by the development of thesteam frigate ultimately failed, leading to thecollapse of the remnants of Spain's empire in the Americas and Asia in 1898 at the hands of a rising power, the United States of America. The political tensions that had driven theCarlist Wars remained unchecked, spilling over once again in theSpanish Civil War of 1936–39. Bringing a foretaste of the tactics of the Second World War, several nations used the conflict as a testing ground for newaerial andarmoured warfare tactics. In the post-war period, Spain has increasingly turned away from the last remaining colonial conflicts inAfrica, and played a growing modern military role within the context of theNATO alliance.
In theclassical period, Spain was a mix ofCeltic andIberian tribal states, andGreek andPhoenician trading ports, with the largest state being the kingdom ofTartessus. With the eruption of war betweenCarthage, aPhoenician colony inNorth Africa and theGreeks, the Carthaginians begin extending their influence in Iberia, creating the city of New Carthage (Cartagena), in hopes of creating a trading empire. Following theFirst Punic War withRome, in 237 BC,Hamilcar Barca, the famous Carthaginian general, then began the conquest ofTurdetania (the successor state ofTartessus) andGades to provide a springboard for further attacks on Rome. Hamilcar entrusted the conquest and military governance of the region to his sonHasdrubal the Fair – his other son,Hannibal, would march his troops across Hispania with elephants to lead them on Rome in theSecond Punic War. During that war, Rome declaredHispania to be a Romanprovincia in 218 BC, beginning a century-long campaign to subdue the people of Iberia to Roman.

After the expulsion of the Carthaginians from Hispania in theSecond andThird Punic Wars, Rome attempted to subdue the native tribes. In the northeasterly province ofHispania Citerior, theCeltiberian Wars occupied Roman forces for the better part of the 2nd century. InHispania Ulterior, theLusitanian War did the same. The resistance of theLusitani underViriathus became legendary across theEmpire. In the troubled final years of theRepublic,Quintus Sertorius held most of Iberia as ade facto independent sovereign against the partisans ofSulla. His attitude towards the natives and his military reforms – he was apartisan ofMarius – secured him the loyalty of thepopulace and the army and his general success until hisassassination. TheSpanish era, a dating system predominant in Iberia until the close of theMiddle Ages, began in 38 BC. The last region of Hispania to be subjected was the northwest, finally being conquered in theCantabrian Wars, which ended in 19 BC.[1]
Under Roman rule, Hispania contributed, like the rest of empire, to the Roman military, providingauxiliary forces, in particularalaecavalry, and laterlegionaries, . Hispania also shaped Roman military affairs more subtely. The original RomanGladius, theGladius Hispaniensis, stemmed directly from theCeltiberian infantry sword used in Carthaginian Spain; this would form the basis of the Roman weapon for several centuries. Some of Rome's most famous military Emperors, includingTrajan,Hadrian andTheodosius, were born in Hispania.
During the 3rd through 6th centuries, the Roman Empire was beset by numerous barbarian invaders, mostlyGermanic, whomigrated through its borders and began warring and settling in its territories. While theVandals andAlans were fighting each other for supremacy in southernGaul, the confederation of theSuevi crossed thePyrenees and passing throughVasconia, enteredGallaecia in 409. The Vandals soon followed the Suevi example, with the Alans close behind. The Alans settled inLusitania andCarthaginiensis and theSiling Vandals inBaetica, while theAsding Vandals vied with the Suevi for Gallaecia. TheVisigoths crossed the Pyrenees to expand their kingdom in 416. They pushed the Vandals and Alans south, defeating and killing the Alan kingAttaces in 426 and forcing the two tribes to amalgamate and retreat across theStraits of Gibraltar into Africa. For almost thirty years, Spain was the location for vicious tribal conflicts.

The first barbarians to settle were theSuevi, whose kingHermeric, a formerfoederatus of Rome, ratified a peace with the local Hispano-Roman population in 438. Weary of fighting, Hermericabdicated in favour of his sonRechila. As theVisigothic kingdom expanded into Iberia, expelling the Vandals and Alans, the Suevi expanded their own realm as far south asMérida. In 456, the new Catholic king,Rechiar, died in battle with the Visigoth kingTheodoric II and the Suevi kingdom began to retreat under Gothic pressure. Beset by internal political conflict, the Suevi capitulated to the Visigoths in 585. Some resistance was maintained for a few years, but soon the last of Suevi resistance was erased.
The Visigoths consolidated a kingdom spanning most of Iberia and Gaul. For the next two centuries, they warred not only amongst themselves in a sequence of succession crises – which followed the election of a new king after every royal death,[2] but also against theByzantine Empire, which was trying to regain lost territory in the south, theArian Suevi trying to preserve their hold on Gallaecia, and theFranks pushing south against them from Gaul. The Visigoth military structure was highly decentralised – the great territorialmagnates, theduces (dukes), maintained their own armies, as in all the great Germanic kingdoms of Europe at the time. These armies rarely cooperated in campaigns.[3] At theBattle of Vouillé in 507, the Franks underClovis I wrested control ofAquitaine from the Visigoths. The Visigoths lost all of their territory north of thePyrenees except the province ofGallia Narbonensis. The first half of the 6th century was largely a failure for the Visigoths. They failed to hold onto their Gallic possessions, they failed to oust the Suevi, and they failed to repulse theByzantine Empire when it first endeavoured to reassert control over its Iberian provinces, taking advantage of a local rebellion.[4] In 554, Granada and southernmostHispania Baetica were taken from the Byzantines; under the last Arian king,Leovigild, the Suevi kingdom wasannexed in 585 and the war of reconquest against the remainder of the Byzantine territories was begun, finally being completed under KingSuintila in 624. The Visigoths faced no serious external threat from then on until the suddenMoorish invasion of 711.
For almost seven hundred years, Spain was the battleground for the opposing forces of the IslamicCaliphate and Western Christian forces. Both Muslims and Christian were motivated by religious conviction, which inspired the warfare. The initialIslamic invasion of Iberia was sudden and unexpected. The variedMoorish tribes ofMorocco united under the leadership ofArab generals sent by the reigningUmayyadcaliph and crossed theStraits of Gibraltar in 711 under the leadership of theBerberTariq ibn Ziyad. Tariq won a swiftvictory at the Guadalete and defeated and killed the reigning Gothic king,Roderic.[5] In a campaign lasting eight years, the whole of Iberia was subjected to Umayyad authority, except for theAsturias mountain range in the far northwest and the pockets of resistance inNavarre. The Islamic offensive ultimately paused after the losses it suffered inFrankland and in theAsturias, where battles such as those atTours andCovadonga showed some of the potential weaknesses of the Arab methods of warfare.[6]

The Islamic conquest was only very slowly undone, over the course of seven centuries in what the Christians of Spain called theReconquista. Three main forces were involved in this process, the Visigothic holdouts in the Asturias, the holdouts in Navarre and the Pyrenees, and the Franks of Aquitaine. The Reconquista, as a concerted effort to remove the Muslims from the territories they held, commenced in the reign ofAlfonso I (739–757). Alfonso led an offensive into the valley of theDuero and left the region depopulated, the so-called "Desert of the Duero". For the next century, this prevented any serious Islamic incursions into the Christian territories of the north. During the late 8th and early 9th centuries, the Franks under theirCarolingian rulers took up the cause of reconquest along the Mediterranean littoral. By 797,Charlemagne's son,Louis the Pious, capturedBarcelona, establishing a clear bulwark against future invasions. The Basques extended their kingdom as far asNájera, and a widespreadrepoblación of the depopulated areas began, extending Christian borders southwards.[7]
Despite a resurgence during the 10th century, theCaliphate of Córdoba's attempts to reverse theReconquista failed, and by the 11th century, Christian Iberia was united underSancho the Great, theKing of Navarre, whilst the caliphate was divided and engulfed by civil war, the period of thetaifas. The 11th century saw the development of a concept of Christian holy war, to be waged against Islam with the purpose of the Christians recapturing long lost territories – theCrusade. Crusading, under other names, also took place in Spain; Franks andNormans and evenPapal troops took to Spain in increasing numbers to join the locals in their fight against "the Moor." The last threat of the 11th century came in the form of theAlmoravids, who with their well disciplined forces first established a hegemony overMorocco and then extended it over al-Andalus. While theReconquista paused in the west, to the eastAlfonso the Battler, theKing of Aragon, redoubled efforts to retake the valley of theEbro. In 1212, theReconquistadores gained a decisive victory over theAlmohads at theBattle of Las Navas de Tolosa. Shortly after the battle, the Castilians tookBaeza and, then,Úbeda, major fortified cities near the battlefield, and gateways to invade Andalucia. Thereafter,Ferdinand III of Castile retookCórdoba in 1236,Jaénin 1246, andSeville in 1248; then he tookArcos,Medina-Sidonia,Jerez and Cádiz, effectively bringing the bulk of thereconquista to a conclusion.

Late medieval Spain was divided into the three Christian kingdoms ofNavarre,Castile andAragon, alongside the small, last remaining Islamic state ofGranada. The civil wars and conflicts of the late 14th and early 15th century would result in the unification of the Christian kingdoms; combined with advances in naval technology, this would pave the way for the rise of Spain as a dominant European power.
Castile, a medium-sized kingdom with a strong maritime tradition, was plunged into civil war following the death ofAlfonso XI in 1349; the conflict betweenPedro of Castile andHenry II of Castile became bound up with the wider politics of theHundred Years' War. With France supporting Henry and his descendants, England made efforts to weaken his regime. Attempts byJohn I, Henry's son, to unify Castile and Portugal, resulted in a Portuguese uprising and the intervention of the English commanderJohn of Gaunt, claiming the Castilian throne by right of marriage. Not until 1387 was the civil war finally concluded, with John of Gaunt accepting a cash settlement.[8] Aragon, a smaller kingdom but with widespread claims to lands across theMediterranean, also saw internal clashes over dynastic inheritance;Peter IV fought a harsh campaign against his nobles from 1346 to 1349 over his daughter's right to inherit the throne.
The threat of internal stability remained until the marriage ofQueen Isabella I ofCastile andKing Ferdinand II ofAragon in 1469. The two monarchs were promptly challenged byJoan of Castile but were swiftly successful. Isabella would go on to establish theHermandadmilitia system, which would provide her with a royal counterbalance to any future challenge from the nobility.[9] The two monarchs proceeded toconquer theKingdom of Granada, the last Islamic state in the Iberian peninsula, which was completed by 1492. In that same year, theAlhambra Decree was issued, expelling all Jews from both Castile and Aragon. Now unified, Spain now enjoyed relative internal stability; rights and lands across the Mediterranean; and a strong tradition of seafaring in both the Atlantic and Mediterranean, which it would maximise in the coming decades.
AfterChristopher Columbus's successful navigation to theNew World under Spanish patronage, Spanish forces rapidly began to occupy much of the new territories, rapidly taking theBahamas and effectively destroying the localArawak speaking indigenous groups. The efforts ofFerdinand Magellan, reaching the island of Limasawa in 1521,[10] led to the subsequent establishment of the colony of thePhilippines underMiguel López de Legazpi which was to become an essential Spanish military base in the Pacific. The challenge of theBarbary Pirates encouraged defensive and punitive expeditions across the Mediterranean, resulting in the conquest of various outposts in North Africa, includingMelilla in 1497,Mazalquivir in 1505,Oran in 1509,Algiers in 1510,Tripoli in 1511 and the smallerPlazas de Soberania.
The most dramatic impact of Spanish military power, however, lay in thedefeat of the American empires of theAztecs andIncas. From 1519 to 1521, a coalition army of Spanish soldiers andTlaxcalan warriors led byHernán Cortés andXicotencatl the Youngerdefeated theAztec Empire; in 1532,Francisco Pizarro and his brothersGonzalo andHernandoinvaded and occupied theInca Empire from their base inPanama. Both wars in which very small numbers of Spanish soldiers – theconquistadors – who were mostly veterans of Spain's European or North African campaigns, were backed by local allies and defeated well established empires, shared many similarities. The highly proficient conquistadors benefited from their access tocavalry,steelswords, axes, spears, pikes, halberds, bows, crossbows,helmets and armour, not to mention smallcannon, none of which were familiar to local forces. The Spanish also benefited from their immunity to many common European diseases which were to decimate their local enemies.[11]
Spain had one of its worst military defeats in the War by Fire and blood (also known as theChichimeca war). They were defeated by the native allies of the Great Chichimeca north of the Aztec empire. This war was very distinct considering the natives created arrows that were very effective at penetrating armor. They had to pay the natives for peace.
The Spanish were to fare less well against the less centralised societies of southern Chile, however, particularly once local forces began to adapt to, or actually adopt similar military technologies. AlthoughPedro de Valdivia was able to successfullyinvade Chile in 1540, the first great rebellion of theArauco wars was to begin only 1553 later, marking the beginning of a conflict that would last until the 19th century.[12] Spanish forces, operating at huge distances from their European or even Caribbean centres of power, were frequently available in small numbers; Valdivia had great difficulty in recruiting even the 150 Spanish soldiers he used to invade Chile, and the frequent reversals during the Arauco wars led to losses that often took several years to replace. As time progressed, the advantages of the Spanish began to increasingly centre on their access to early modern firearms, especially themusket, rather than the technologies that had won them their early successes.[13]
During the 16th and 17th centuries,Habsburg Spain (1516-1700) saw a steady growth in its military power. TheItalian Wars (1494–1559) resulted in an ultimate Spanish victory and hegemony in southern Italy and in the Duchy of Milan by expelling the French. During the war, the Spanish army transformed its organization and tactics, evolving from a primarily pike and halberd wielding force into some of the firstpike and shot formation ofarquebusiers andpikemen, known as the colunella. During the 16th century this formation evolved into thetercio infantry formation. The new formation and battle tactics were developed because of Spain's inability to field sufficient cavalry forces to face the heavy French cavalry.[14] Spain's army would enjoy over a century of land supremacy in Europe, with the tercios earning a feared reputation amongst all opposing armies. Habsburg Spain came to enjoy an axis of allied and neutral territories fromNaples throughMilan and northwards to theNetherlands, a route for reinforcements that came to be called theSpanish Road.[15] Backed by the financial resources drawn from the Americas,[16] Spain could afford to mount lengthy campaigns against her enemies, such as the long runningDutch revolt (1568–1609), defending Christian Europe from Ottoman raids and invasions, supporting the Catholic cause in theFrench civil wars and fighting, England during theAnglo-Spanish War (1585–1604).
By one modern estimate, the Spanish army in 1625 was 230,000 regulars (80,000 in field armies, 150,000 in garrisons), exclusive of naval personnel and militia.[17] By another the Spanish army grew in size from around 20,000 in the 1470s, to around 300,000 by the 1630s during theThirty Years' War that tore Europe apart, requiring the recruitment of soldiers from across Europe.[18] KingPhilip IV himself stated in 1626: "Last year, 1625, we had nearly 300,000 infantry and cavalry in our pay, and over 500,000 men of the militia under arms, whilst the fortresses of Spain are being put into a thorough state of defence. The fleet rose at one time in 1625 to 108 ships of war at sea, without counting the vessels at Flanders, and the crews are the most skillful mariners this realm ever possessed. This very year of 1626 we have had two royal armies in Flanders and one in the Palatinate, and yet all the power of France, England, Sweden, Venice, Savoy, Denmark, Holland, Brandenburg, Saxony, and Weimar could not save them from our victorious arms."[19]
With such numbers involved, Spain had trouble funding the war efforts on so many fronts. The non-payment of troops led to manymutinies and events such as theSack of Antwerp (1576), when unpaidtercio units looted the Dutch city. Spain's holdings in Italy and the Low Countries contributed large amounts of men and treasure to the empire's army: each province was allotted a number of troops it had to pay for (including the ethnic Spanish garrisons) and recruits it had to provide. Troops were generally sent outside of the areas they were recruited in.[20] From 1635 to 1659, the Duchy of Milan provided 100,000 soldiers to the Spanish army, while the Kingdom of Naples provided 53,500 (plus a naval expedition) from 1631 to 1636 alone.[21]
In the east, Habsburg Spain fought alongside other Christian allies against theOttoman Empire, taking part in numerous actions and campaigns in and around the Mediterranean over the period. The naval competition culminated in victory for the Christian alliance at thebattle of Lepanto in 1571, the last naval battle in the Mediterranean to see the large scale use ofgalleys by both sides. In the middle of the century, Spain developed thegalleon for naval warfare, using them in convoys to link her possessions in thePhilippines, the Americas and Europe.[22][23]TheManila galleons sailed once or twice per year across the Pacific Ocean, whilst theSpanish treasure fleets linked Mexico back to Europe.[24]

Spain fought theCastilian War against theBruneian Empire. Spanish forces attempted to conquer Cambodia in theCambodian–Spanish War but were defeated. The Moros fought against the Spanish invasion for centuries in theSpanish–Moro conflict. TheIgorot people resisted and fought against the Spanish.
The Thirty Years' War (1618–1648) drew in Spain alongside most other European states. Spain entered the conflict with a strong position, but the ongoing fighting gradually eroded her advantages; first Dutch, then Swedish innovations had made thetercio faced more competition, having to go up against increasingfirepower from its Protestant counterparts.[25] Nevertheless, Spanish armies continued to win major battles and sieges throughout this period across large swathes of Europe. French entry into the war in 1635 put additional pressure on Spain, with the French victory at theBattle of Rocroi in 1643 being a major boost for the French, though it proved far from decisive in the long-runningFranco-Spanish War (1635–1659). By the signing of thePeace of Westphalia in 1648, which brought an end to most of the fighting, Spain was clearly exhausted. Politics too had begun to count against Spain. While Spain was fighting France, Portugal – which had been under personal union with Spain for 60 years – acclaimedJohn IV of Braganza as king in 1640.

Spain was forced to accept the independence of theDutch Republic in 1648, another sign of diminishing power. In the second half of the century, a much reduced and increasingly neglected Spanish army became infamous for being poorly equipped and rarely paid.[26] For the remainder of the century, France continued to grow in relative power underLouis XIV. The Franco-Spanish War (1635–59) ended in defeat. However, despite some Spanish concessions (Roussillon andFrench Flanders); the Spanish maintained their main territorial holdings in the Low Countries and Italy. TheWar of Devolution (1667–68) proved a one sided affair, as French forces overcame badly neglected Spanish forces and fortifications, marking the military ascendancy of France. The outcome of theWar of the Reunions (1683–1683) had a similar outcome. During theNine Years' War, Spain also lost Catalonia to France but it was restored to the kingdom in 1697 with thetreaty of Ryswick.

The centre of Spanish military power shifted dramatically in the early 18th century. TheWar of the Spanish Succession (1701–1714) was both a civil and international war in which the French backed the Bourbon contender for the Spanish throne and an alliance led by Austria, the Dutch Republic and Britain backed the Habsburg contender while a divided Spain fought on both sides. The war secured the Spanish throne for the BourbonPhilip as Philip V of Spain at thePeace of Utrecht but in the war's settlement, Spain had to give up theSpanish Netherlands,Naples,Milan,Sardinia,Sicily,Gibraltar andMenorca to the Habsburg allies. Spain's defeat by the combined alliance of France, Britain, the Netherlands and Austria in theWar of the Quadruple Alliance (1718–1720) confirmed the decline from her former dominance, whilst the successful deployment of the Britain'sRoyal Navy into the Mediterranean, by exploiting the fortress ofGibraltar, gained in 1704 by an Anglo-Dutch force during the war of succession, would create considerable difficulties in the following years.[27]
Globally, Spain remained an important naval and military power, depending on criticalsea lanes stretching from Spain through the Caribbean and South America, and westwards towards Manila and the Far East. The 18th century saw an ongoing struggle between the growing naval power of the rising imperial power Great Britain and Spain that worked to maintain it transoceanic links with its overseas empire, still by far the largest of the time. The number ofSpanish galleons deploying across the Atlantic sea routes increased significantly in the first half of the century, undoing the decline of the latter 17th century.[28] Britain engaged in numerous attempts to disrupt Spain's control over theSpanish Main during the early 18th century, culminating in theWar of Jenkins' Ear and adisastrous attempt to capture the port of Cartegena in 1741.[29] During theSeven Years' War (1756–1763), Britain leveraged its existing island bases along theSpanish Main and theSpanish West Indies,capturing Havana andManila, but in each case practical and strategic considerations led to their return in exchange for Florida. During theAmerican Revolutionary War, Spanish forces reconquered Florida and assisted the American rebels with arms and soldiers and by attacks on British trade and supplies. Both Spain and Britain made extensive use of privateers throughout the war, the Spanish exploiting the British aversion to using theconvoy system to protect its expensive merchant assets in times of war. The earlierWar of the Polish Succession was still seen as positive for Spain, as the kingdom did recover the territories lost after the war of Spanish succession, in Italy. However, during the Seven Years' War,three Spanish attempts to conquer Portugal ended in crushing disasters.

The huge distances involved in warfare between European powers in the Americas usually counted in favour of the defenders. Attacks on Spanish possessions, such as the amphibious assaults launched during the War of Jenkins' Ear usually ended in failure as their overstretched forces failed to overcome well led defensive actions. Spain'sinvolvement in the American Revolutionary War (1779–83) was largely a success, underlining the resources that Spain still had at its disposal. Spain entered the war after theBattle of Saratoga, with the aim, as in the Seven Years' War, of recoveringGibraltar andMenorca and retaking the British colonies near New Spain. Their successfulinvasion of Menorca in 1781,[30] and the capture ofWest Florida andEast Florida from the British, showed a renewed strength in the New World, although the Britishdefence of Gibraltar prevented the Spanish achieving all their war goals.[31]

TheNapoleonic Wars were to have a tremendous impact on Spanish military history, both within Spain itself and across her American colonies. The armies of theFirst French Empire deposedFerdinand VII of Spain, andSpain's subsequent liberation struggle marked one of the firstnational wars and the emergence of large-scaleguerrillas, from which theEnglish language borrowed the word.[32] The French occupation destroyed theSpanish administration, which fragmented into quarrellingprovincial juntas. In 1810, the factions coalesced in the form of theCortes of Cádiz, which served as a democratic Regency based in their last major foothold. DuringNapoleon's two year longSiege of Cádiz, it was difficult for the Cortes of Cádiz to recruit, train, or equip effective armies. However, Napoleon's failure to pacify the people of Spain allowed British, Portuguese and Spanish forces to secure Portugal and engage French forces on the frontiers, while Spanishguerrilleros wore down the occupiers.[33]
As to the role played by the Spanish armies, David Gates notes, "Furthermore, irrespective of the quality of their men, the Spanish armies constituted a threat that the French quite simply could not ignore. Any sizeable concentration of enemy soldiers had to be engaged, or at least contained, by a sufficiently strong force of Imperial troops; otherwise they were free to go on the rampage with impunity. Consequently, a colossal percentage of the French army was rendered unavailable for operations against Wellington because innumerable Spanish contingents kept materialising all over the country."[33] Acting in concert, regular andirregular allied forces prevented Napoleon'smarshals from subduing the rebellious Spanish provinces.[34] The Spanish navy, put to sea in support of France during theWar of the Third Coalition in 1805, suffered terrible losses at theBattle of Trafalgar, having been weakened byyellow fever in the preceding years; in many ways this marked the nadir of Spanish naval history.

The events in mainland Spain had extensive consequences for her empire. Spain's colonies in the Americas had shown an increasing independence in the years running up to thePeninsular War; theBritish invasions of the River Plate in 1806 and 1807, for example, had been rebuffed by well organised local militia.[35] The occupation of the Spanish homeland, however, resulted in first a sequence of uprisings in support of the imprisoned king, and then astruggle for independence that increasingly formed a series of civil wars across the Spanish dominions in the America. The conflict started in 1808, withjuntas established inMexico andMontevideo in reaction to the events of the Peninsular War. The conflict, lasting twenty years, was far from one sided. Patriot forces were often underequipped, largely peasant militia armies commanded by amateur officers; Royalist forces, partially supported from Spain over huge sea distances, were frequently able to gain the upper hand.[36]
The Spanish navy was easily able to dominate the local, coastal navies of her colonies. Campaigning across the huge distances of South America, frequently in winter conditions with minimal supplies, resulted in terrible privation. Ultimately, Royalist exhaustion and growing political maturity amongst the new states resulted in the creation of a chain of newly independent countries stretching fromArgentina andChile in the south to Mexico in the north. OnlyCuba andPuerto Rico remained underSpanish rule.

In the aftermath of theNapoleonic Wars, Spain's military found itself involved in an increasing number of internal conflicts, distracting military attention from other priorities, and continuing to undermine the Spanish economy.[37] The first of these, theTrienio Liberal (1820–23) involved a revolt by soldiers against KingFerdinand VII while they were being embarked for a campaign in America.[38]France intervened militarily to support the monarchy, restoring order, but this was short-lived. In 1830 the Spanish Army had a size of 250,000 active soldiers, and 50,000 reserves, but it was still a divided nation with internal conflicts. When Ferdinand died in 1833, his fourth wife Maria Cristina became Queen regent on behalf of their infant daughterIsabella II. This splintered the country into two factions known as the Cristinos – the supporters of the Queen regent – and theCarlists, the supporters ofCarlos V, who had rejected thePragmatic Sanction of 1830 that abolished theSalic law.[39] TheFirst Carlist War lasted over seven years and the fighting spanned most of the country at one time or another, although the main conflict centered on the Carlist homelands of theBasque Country andAragon. Many of the military officers involved had served in thePeninsular War a few years before. TheSecond Carlist War was a minorCatalan uprising in support ofCarlos VI, lasting from 1846 to 1849. TheThird Carlist War began after Queen Isabella II was overthrown by a conspiracy of liberal generals in 1868, and left Spain in some disgrace; four years later, the latest Carlist pretender,Carlos VII, decided that only force of arms could win him the throne. This Third Carlist War lasted until 1876.[39]

UnderIsabella II of Spain, there were several, ultimately unsuccessful, attempts to reassert Spanish military influence around the world, often in partnership withFrance. In 1848 Spain intervened to supportPope Pius IX against local republican opposition. In February 1849, five warships, including thefrigates steamed to Gaeta fromBarcelona, three more fromCádiz following in May.[40] In total, 4,000 Spanish soldiers were deployed in Gaeta and placed at the Pope's disposition. This marked theSpanish Army's first expeditionary venture into Italy since theWar of the Austrian Succession a hundred years prior. In partnership with the French, Spanish columns secured the region. In 1858 Spain joined with France to intervene inCochin China, donating 300 Filipino troops to the invasion.[41] Spain joined an allied expedition in support of theSecond French intervention in Mexico. In 1859, Spainfought a short war with Morocco, resulting in a stronger Spanish position in North Africa. By the 1860s, Spain had built up a very large navy again, and in 1864 Spain intervened along the South American cost, seizing theguano-richChincha Islands from its former colony ofPeru. Although the new Spanishsteam frigates were superior to local vessels, the huge distances and lack of land support ultimately concluded with Spain handing back the islands at the end of theChincha Islands War. An attempt torecolonise Santo Domingo similarly failed by 1865 in the face of fierce guerrilla resistance.
Spain faced a sequence of challenges across her colonies in the second half of the century that would result in a total defeat of empire at the hands of the growing power of the United States. Spain's colony ofCuba rebelled in 1868, leading to a sequence of brutal guerrilla insurgencies and retaliations,[42] through theTen Years' War (1868–1878), theLittle War (1879–1880) and finally theCuban War of Independence (1895–1898). Spain, although militarily occupied with the Carlist troubles at home, put increasing resources into the conflict, slowly taking the upper hand,[43] and assisted by American sales of modern weaponry.[44] By 1898, however, increasing U.S. political interests in Cuba were encouraging a more interventionist policy. Thesinking of the USSMaine inHavana harbour provided the trigger for theSpanish–American War, in which Spain's aging navy fared disastrously.Cuba gained its independence and Spain lost its remaining New World colony,Puerto Rico, which together withGuam and thePhilippines it ceded to the United States for 20 million dollars. In 1899, Spain sold its remaining Pacific islands – theNorthern Mariana Islands,Caroline Islands andPalau – to Germany, reducing Spain's colonial possessions toSpanish Morocco, theSpanish Sahara andSpanish Guinea, all in Africa.
Although Spainremained neutral duringWorld War I, despite suffering considerable economic losses to Germansubmarines,[45] she was militarily active elsewhere during the early part of the 20th century, attempting to strengthen her position in North Africa. Despite successes in the late 19th century, thefirst Rif War (1893–94) aroundMelilla had also shown the potential weakness of the Spanish position along the coast. Thesecond Rif War (1909–10) was initially a fiasco for the under-equipped and undertrained Spanish, until heavyartillery was brought in; in the aftermath of the war, Spain began to raise units of localRegulares. Thethird Rif War (1920–1926) also began badly for the Spanish, especially after thedisaster of Annual (1921), resulting in various changes to the Spanish approach. Working in alliance with French forces in the region, Spain created theSpanish Legion along similar lines to theFrench Foreign Legion to provide additional experienced forces. Spain also became the first country to deploychemical weapons by air, droppingmustard gas from aircraft.[46]

In 1931, following the proclamation of theSecond Spanish Republic, the armed forces of the Spanish Kingdom became theSpanish Republican Armed Forces.TheSpanish Civil War (1936–39) began right after theSpanish coup of July 1936, a partially successfulcoup d'état by a section of the Spanish Army against the government of the Spanish Republic. The ensuing Civil War devastated Spain, ending with the victory of the rebels and the founding of theSpanish State, led bycaudilloFrancisco Franco, the leader of theNationalist army.
The civil war was marked by theextensive involvement of international units.[47] Many joined the Republican side under the banner of theInternational Brigades. The Nationalists enjoyed support fromNazi Germany andFascist Italy, with several new technologies being trialled as a result.[48] The Nationalist side conductedaerial bombing of cities in Republican territory, carried out mainly by theLuftwaffe volunteers of theCondor Legion[49] and theItalian air force volunteers of theCorpo Truppe Volontarie – the most notorious example of this tactic of terror bombings was thebombing of Guernica.[50] The first combat use of theStuka occurred during the conflict. The civil war influenced European military thinking on the alleged supremacy of thebomber.Armoured warfare was also trialled by Nationalist supporters; German volunteers first used armor in live field conditions in the form of the Panzer Battalion 88, a force built around three companies ofPzKpfw I tanks that functioned as a training cadre for Nationalists.
Weakened and politically still fragile, Spainremained officially neutral duringWorld War II. However, to repay Hitler for his assistance in the Civil War, Franco raised a volunteer corps, theBlue Division (with an aerial counterpart, theBlue Squadron), to fight on theEastern Front. In that way, by only fighting the Soviet Union, Franco could repay Hitler while staying at peace with the Western Allies. Nearly fifty thousand Spanish personnel served from June 1941 til October 1943, seeing fierce action in theSiege of Leningrad and theBattle of Krasny Bor. After Franco was pressured by Allied leaders to withdraw the Division, a token force of volunteers remained as theBlue Legion. Fighting for the Allies, many exiled Spanish Republicans, calledSpanish Maquis, joined theFrench Resistance. Thousands also served in theFree French Forces; particularly of note is theNinth Armoured Company underGeneral Leclerc'sSecond Division. The first Allied unit toenter Paris in 1944, it was almost entirely made up of Spanish exiles.

In the post-war period, Spain was initially still heavily influenced by events in North Africa, particularly surrounding its colony ofWestern Sahara The first of these conflicts, theIfni War (1956–1958) saw Spanish forces, including Spain's firstparatroop unit, clash with theMoroccan Liberation Army, a Moroccan state backed insurgency movement. In 1958, a joint French-Spanish offensive, using massively superior European air power, crushed the revolt.[51] In the 1970s, the rise of another insurgency movement,Polisario, resulted in theWestern Sahara War (1973–1991), with Spain withdrawing from its colony in 1975 and transferring its support in the continuing conflict to Morocco.
From the 1950s onwards, however, Spain began to build increasingly close links with the U.S. armed forces. TheSpanish Air Force received its first American jets, such as theF-86 Sabre andLockheed T-33, from America, whilst the equipment of the Spanish military was again modernised in the 1970s to prepare for Spain's membership ofNATO in 1982. Spain sent a small medical unit to theVietnam War, and a team of engineers to theGulf War with Spain lending airpower to the NATO efforts during theBosnian War, theKosovo War andLibyan Civil War. Most recently, Spain has participated in both the conflicts inAfghanistan andIraq.
Historically, in addition to Latin military terms that came down from Roman times into modern Spanish through the language, the Spanish adopted a number of Arabic military terms from their Muslim rivals. Subsequently, a number of Spanish military terms have been adopted into French, English and other languages.
| Spanish term | Original language | Original meaning | Modern English term | Notes |
|---|---|---|---|---|
| alcaide | Arabickaid | master, leader | Medieval Spanish military commander orcastellan. | |
| alcazaba | Arabical-casbah | walledcitadel | ||
| alcázar | Arabical-qasr | castle or palace | Could refer to a residence, citadel, or hilltop fortress. | |
| alférez | Arabic | horseman | Used in medieval Castile-León and Navarre to denote the standard-bearer and commander of the royal military household. In modern usage in Spain and Equatorial Guinea, asecond lieutenant. | |
| almirante | Arabicamir-al-bahr | commander of the seas | admiral | Adopted inLatinisation (ammiratus) by theSiculo-Normans and later brought to Spain by the Catalans after Sicily became part of the Aragonese Crown. |
| armada | Spanish | armed (fem.), later navy, fleet | armada | Came into English usage after the defeat of theGreat Armada in 1588. |
| caballero villano | Spanish | "commoner knight" | Avillein who owned a horse and armour and owed cavalry service. | |
| coronel | Spanish or Italian (colonnello), ultimately Latin (columnella) | diminutive ofcolonna/columna (column) | colonel | Rank popularised by thetercios. |
| destructor | Spanish | destroyer | A large torpedo gunboat, built in Britain for theSpanish Navy to protect the fleet against torpedo boats, a precursor of the modern destroyer type of ship. | |
| flotilla | Diminutive of Spanishflota, from Frenchflotte | (little) fleet | flotilla | |
| granada | Spanish | pomegranate | grenade | |
| guerrilla | Spanish | diminutive ofguerra (war) | guerrilla | |
| Quinta Columna | Spanish | fifth column | Fifth Column | First used during theSpanish Civil War byEmilio Mola at the siege of Madrid in reference to his supporters within the city. |
| tercio | Spanish | third part | Infantry unit developed byGonzalo Fernández de Córdoba during theItalian Wars. |