Peninsular War: A French force under the command of Marshal Victor is routed while trying to prevent an Anglo-Spanish-Portuguese army from lifting the Siege of Cádiz in the Battle of Barrosa.

The Battle of Barrosa (Chiclana, 5 March 1811, also known as the Battle of Chiclana or Battle of Cerro del Puerco) was part of an unsuccessful manoeuvre by an Anglo-Iberian force to break the French siege of Cdiz during the Peninsular War. During the battle, a single British division defeated two French divisions and captured a regimental eagle.

Cdiz had been invested by the French in early 1810, leaving it accessible from the sea, but in March of the following year a reduction in the besieging army gave its garrison of British and Spanish troops an opportunity to lift the siege. A large Allied strike force was shipped south from Cdiz to Tarifa, and moved to engage the siege lines from the rear. The French, under the command of Marshal Victor, were aware of the Allied movement and redeployed to prepare a trap. Victor placed one division on the road to Cdiz, blocking the Allied line of march, while his two remaining divisions fell on the single Anglo-Portuguese rearguard division under the command of Sir Thomas Graham.

Following a fierce battle on two fronts, the British succeeded in routing the attacking French forces. A lack of support from the larger Spanish contingent prevented an absolute victory, and the French were able to regroup and reoccupy their siege lines. Graham's tactical victory proved to have little strategic effect on the continuing war, to the extent that Victor was able to claim the battle as a French victory since the siege remained in force until finally being lifted on 24 August 1812.

The Peninsular War (1807–1814) was the military conflict fought in the Iberian Peninsula by Spain, Portugal, and the United Kingdom against the invading and occupying forces of the First French Empire during the Napoleonic Wars. In Spain, it is considered to overlap with the Spanish War of Independence. The war began when the French and Spanish armies invaded and occupied Portugal in 1807 by transiting through Spain, and it escalated in 1808 after Napoleonic France had occupied Spain, which had been its ally. Napoleon Bonaparte forced the abdications of Ferdinand VII and his father Charles IV and then installed his brother Joseph Bonaparte on the Spanish throne and promulgated the Bayonne Constitution. Most Spaniards rejected French rule and fought a bloody war to oust them. The war on the peninsula lasted until the Sixth Coalition defeated Napoleon in 1814, and it is regarded as one of the first wars of national liberation and is significant for the emergence of large-scale guerrilla warfare.

The war began in Spain with the Dos de Mayo Uprising on 2 May 1808 and ended on 17 April 1814 with the restoration of Ferdinand VII to the monarchy. The French occupation destroyed the Spanish administration, which fragmented into quarrelling provincial juntas. The episode remains as the bloodiest event in Spain's modern history, doubling in relative terms the Spanish Civil War.A reconstituted national government, the Cortes of Cádiz—in effect a government-in-exile—fortified itself in the secure port of Cádiz in 1810, but could not raise effective armies because it was besieged by 70,000 French troops. British and Portuguese forces eventually secured Portugal, using it as a safe position from which to launch campaigns against the French army and provide whatever supplies they could get to the Spanish, while the Spanish armies and guerrillas tied down vast numbers of Napoleon's troops. By restricting French control of territory, the combined allied forces, both regular and irregular, prevented Napoleon's marshals from subduing the rebellious Spanish provinces, and the war continued through years of stalemate.The British Army, under then Lt. Gen. Sir Arthur Wellesley, later the 1st Duke of Wellington, guarded Portugal and campaigned against the French in Spain alongside the reformed Portuguese army. The demoralized Portuguese army was reorganized and refitted under the command of Gen. William Beresford, who had been appointed commander-in-chief of the Portuguese forces by the exiled Portuguese royal family, and fought as part of the combined Anglo-Portuguese Army under Wellesley.

In 1812, when Napoleon set out with a massive army on what proved to be a disastrous French invasion of Russia, a combined allied army under Wellesley pushed into Spain, defeating the French at Salamanca and taking the capital Madrid. In the following year Wellesley scored a decisive victory over King Joseph Bonaparte's army in the Battle of Vitoria. Pursued by the armies of Britain, Spain and Portugal, Marshal Jean-de-Dieu Soult, no longer getting sufficient support from a depleted France, led the exhausted and demoralized French forces in a fighting withdrawal across the Pyrenees during the winter of 1813–1814.

The years of fighting in Spain were a heavy burden on France's Grande Armée. While the French were victorious in battle, they were eventually defeated, as their communications and supplies were severely tested and their units were frequently isolated, harassed or overwhelmed by partisans fighting an intense guerrilla war of raids and ambushes. The Spanish armies were repeatedly beaten and driven to the peripheries, but they would regroup and relentlessly hound and demoralize the French troops. This drain on French resources led Napoleon, who had unwittingly provoked a total war, to call the conflict the "Spanish Ulcer".War and revolution against Napoleon's occupation led to the Spanish Constitution of 1812, promulgated by the Cortes of Cádiz, later a cornerstone of European liberalism. The burden of war destroyed the social and economic fabric of Portugal and Spain, and ushered in an era of social turbulence, increased political instability, and economic stagnation. Devastating civil wars between liberal and absolutist factions, led by officers trained in the Peninsular War, persisted in Iberia until 1850. The cumulative crises and disruptions of invasion, revolution and restoration led to the independence of most of Spain's American colonies and the independence of Brazil, which remained a monarchy, after severing ties with Portugal.