In March 1809 he led a force which carried out the successful Siege of Chaves from its French garrison. He kept the French from capturing Amarante from 18 April to 3 May 1809 during the second French invasion of Portugal. Driven out, he later recaptured the place and helped cut off the forces of Nicolas Soult, forcing the French marshal to abandon his artillery and wagon trains in order to escape. He commanded a Portuguese division in Arthur Wellesley, Marquess of Wellington's Allied army at the Battle of Vitoria on 21 June 1813.