Sir Arthur Wellesley (the future Duke of Wellington) entered Portugal in early July with 20,000 British troops, intending to link with General Cuesta’s Spanish army. Meanwhile Cuesta, confronted by Joseph Bonaparte’s larger French army, had withdrawn to Talavera beside the Tagus, with the French in pursuit. Coming upon the now combined enemy, Bonaparte ordered General Ruffin to capture the strategic hill named Cerro de Medellin. Repeated attacks were launched, but repulsed, ultimately by a British bayonet charge. When the British counterattacked, a cavalry charge blundered into a ravine, while Guardsmen were trapped in an enfilade. However, when the French renewed their assault on the Cerro, and attempted to outflank the British positions, they were once more blocked. Overnight, Bonaparte reviewed the situation, and decided to withdraw, leaving the Anglo-Spanish alliance with a tactical victory. However, in the aftermath of battle, Wellesley’s army was almost trapped by the main French army, and retreated to Portugal.