The Battle of Bailén was fought in 1808 between the Spanish Army's Army of Andalusia, under General Francisco Javier Castaños and the French Imperial Army's 2nd Gironde Observational Corps under Divisional-General Pierre Dupont de l'Étang. The first open-field defeat of a Napoleonic army, the battle's heaviest fighting took place near Bailén (sometimes anglicized as Baylen), a village by the Guadalquivir river in the Jaén province of southern Spain.
In June 1808, following the widespread uprisings against the French occupation of Spain, Napoleon organized French units into flying columns to pacify Spain's major centres of resistance. One column under Dupont was dispatched across the Sierra Morena and south through Andalusia towards the port of Cádiz where a French naval squadron lay at the mercy of the Spanish. The Emperor was confident that with 20,000 men, Dupont would crush any opposition encountered on the way, despite most of them being inexperienced new recruits. Events proved otherwise when Dupont and his men stormed and plundered Córdoba in July. General Castaños, commanding the Spanish field army at San Roque, and General Theodor von Reding, Governor of Málaga, travelled to Seville to negotiate with the Seville Junta—a patriotic assembly committed to resisting the French incursions—and to turn the province's combined forces against the French. Upon learning of the approach of a larger Spanish force, Dupont fell back to the north of the province. Sick and burdened with wagons of loot, he unwisely decided to await reinforcements from Madrid. However, his messengers were all intercepted and killed and a French division under General Dominique Vedel, dispatched by Dupont to clear the road to Madrid, became separated from the main body.