Here he was confronted in 1697 with an invasion of French troops commanded by Louis Joseph de Bourbon, Duke of Vendôme which besieged and took Barcelona on 10 August.