the talks, Dupont had agreed to surrender not only his own but Vedel's force as well even though the latter's troops were outside the Spanish encirclement with a good chance of escape; a total of 17,000 men were captured, making Bailén the worst defeat suffered by the French in the entire Peninsular War. The men were to be repatriated to France, but the Spanish did not honor the surrender terms and transferred them to the island of Cabrera, where most died of starvation. When news of the catastrophe reached Joseph Bonaparte's court in Madrid, the result was a general retreat to the Ebro, abandoning much of Spain to the insurgents. France's enemies throughout Europe cheered at this first major defeat inflicted to the hitherto unbeatable French Imperial army. "Spain was overjoyed, Britain exultant, France dismayed, and Napoleon outraged. It was the greatest defeat the Napoleonic empire had ever suffered, and, what is more, one inflicted by an opponent for whom the emperor had affected nothing but scorn."—tales of Spanish heroism inspired Austria and showed the force of nationwide resistance to Napoleon, setting in motion the rise of the Fifth Coalition against France. Alarmed by these developments, Napoleon decided to personally take command of the Spanish theatre and invaded Spain with the Grande Armée. They dealt devastating blows to the vacillating Spanish rebels and their British allies, recapturing the lost territories, Madrid included, in November 1808, before turning their attention to Austria. The struggle in Spain continued for many more years. Enormous resources were committed by the French to a long war of attrition waged against determined Spanish guerrillas, ultimately leading to the expulsion of L'Armée d'Espagne (The Army of Spain) from the Iberian Peninsula and the exposure of southern France to invasion in 1814 by combined Spanish, British, and Portuguese forces. Background The Spanish conventional warfare had started with the Battles of El Bruch. Months before, thousands of French troops had marched into Spain to support a Spanish invasion of Portugal orchestrated by Napoleon, who used the opportunity to initiate intrigues against the Spanish royal family. A coup d'état, instigated by Spanish aristocrats with French support, forced Charles IV from his throne in favour of his son Ferdinand, and in April, Napoleon removed both royals to Bayonne to secure their abdication and replace the Spanish Bourbon line with a Bonapartist dynasty headed by his brother Joseph Bonaparte. However, none of