a war that was fought in Spain and Portugal between the armies of France, led by Napoleon, and of Britain, led by the Duke of Wellington. It began when Napoleon attacked Spain in 1808 and ended when he was defeated and forced to leave Spain in 1813. (1808-14) Part of the Napoleonic Wars, fought on the Iberian Peninsula. After French forces occupied Portugal (1807) and Napoleon installed his brother Joseph Bonaparte as king of Spain (1808), a rebellion in Madrid began what was called in Spain "the War of Independence," and insurrections soon erupted in other cities. By 1810 the French overcame the Spanish rebels in Madrid and elsewhere in Spain. Meanwhile, the British under the future duke of Wellington landed in Portugal (1808), where they fought the French in inconclusive campaigns until 1812. After Napoleon withdrew French forces to bolster his invasion of Russia, Wellington began his gradual advance into Spain. The British victory at the Battle of Vitoria (1813) and their march into southwestern France forced the French to withdraw from Spain and to reinstall Ferdinand VII as king (1814)