Blake and Cuesta were defeated on 14 July at Medina del Rio Seco. Following the general French retreat prompted by the disaster at Bailén, Blake took up positions opposite the enemy on the banks of the Ebro. On 31 October Marshal Lefebvre's IV Corps fell upon Blake's 19,000 men at Battle of Zornoza, turning back the hesitant Spanish advance. To his credit, Blake retreated swiftly and in good order, preventing Napoleon's planned envelopment and annihilation of the Spanish flank.