In 1710 he commanded the British contingent of the Allied Army which occupied Madrid having won a decisive victory at the Battle of Zaragoza. Having then evacuated the Spanish capital, Stanhope's rearguard on the retreat to Barcelona were overwhelmed and forced to surrender at Brihuega.