Following the French retreat from the disaster at the Battle of Bailén (16–19 July 1808), Blake took up positions opposite the enemy on the banks of the Ebro. On 31 October, the 24,000 men of Marshal Lefebvre's IV Corps attacked Blake's 19,000 men at Zornoza. By retreating swiftly, Blake was able to prevent being trapped by Napoleon's planned envelopment and annihilation of the Spanish flank.