He was briefly governor of Madrid before returning to the battlefield at the Battle of Bayonne and at Vitoria, where he was again wounded.