Castaños is remembered for his victory over the French under Dupont, whom he surrounded and compelled to surrender at the decisive Battle of Bailen in 1808, being on that moment in command of the "Army of the South", the biggest Spanish military unit during the Napoleonic War. Though just months later lead his army to a decisive defeat at the Battle of Tudela. After this he served under Wellington in several engagements, and was commander of the Spanish army, if required, to invade France in 1815.