When war with France broke out in 1808, Cuesta was already 67 years old. He was at first reluctant to lead the insurgents who rose up in Valladolid but agreed after a gallows was erected outside his house and the indignant populace threatened to hang him. His army was ramshackle, ill-trained and underequipped and his hastily recruited force of 5,000 militia stood little chance against the Grande Armée of Napoleon. It was heavily defeated at Cabezón, forcing Cuesta's withdrawal from his seat of command at Valladolid. Cuesta managed to combine what was left of his army with Lieutenant General Blake'sArmy of Galicia but, pulling rank and insisting on a foolhardy march on Valladolid, left his new force vulnerable to a French counterattack. Paralyzed by disunity of command, the pair were defeated on 14 July at the Battle of Medina de Rioseco when Cuesta failed to close the gap between his troops and Blake's. Negotiations with the Central Junta led to Cuesta's brief promotion to Commander-in-Chief of the Spanish Army. In the absence of a military and political command structure, strategy and coordination with other Spanish forces proved impossible. He was soon sacked and arrested due to political machinating by his opponents. Following the loss of Madrid to Napoleon at the Battle of Somosierra the situation in Spain became more desperate and Cuesta was allowed to reconstitute the Army of Extremadura in order to defend the southern frontier. In defiance of the military wisdom of the time Cuesta pursued an offensive as soon as he had constructed a fighting force. This met with success. In January and February 1809, all of Badajoz was reclaimed from the French. Cuesta was refused supplies and reinforcements until local authorities could review the appointments he had made to the army. As a result, a French offensive in the Spring annulled Cuesta's previous gains. On 26 March, Cuesta was badly wounded and trampled by cavalry, and his army savagely defeated, at the Battle of Medellín. Like Blücher after him, he continued fighting as a near-invalid. Cuesta joined forces with the British army under Wellington. Relations with his British allies were difficult, Cuesta promising and then failing to supply the British troops more than once, much to Wellesley's irritation. Further difficulties arose in the aftermath of the Battle of Talavera. Though the Anglo-Spanish army won the costly battle, Wellington planned for a withdrawal to stop French General Nicolas Soult and 30,000 troops cutting him off from Portugal. Cuesta refused to co-operate. Later, Wellington was furious when he heard that Cuesta abandoned the injured British soldiers Wellesley left in his care to the French as prisoners. More Spanish defeats followed as Cuesta attempted to fight the French without co-ordinating with his allies or attempting to gain prior advantage. In 1810, Cuesta suffered a serious stroke from which he died in retirement a year later. Cuesta's reputation was that of a hopelessly proud, arrogant, xenophobic, and reactionary officer. While his personal bravery was never in question, Cuesta's reputation suffered during and after the war, due mainly to his limited understanding of the Spanish army's deficiencies but also his behaviour to fellow officers and allies. His arrogance led him to attempt to fight the veteran French armyhead on with several disastrous results.