The Peninsular War (1808–1814) was fought in the Iberian Peninsula by the Iberian nations Spain and Portugal, along with 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. It overlapped with the War of the Fifth Coalition (1809) and the War of the Sixth Coalition (1812–1814).
The war can be said to have started when the French and Spanish armies invaded and occupied Portugal in 1807 by transiting through Spain, but it escalated in 1808 after Napoleonic France occupied Spain, which had been its ally.