In the first years of the war, he fought in Naples against supporters of Archduke Charles, led by Gaetano Gambacorta, Prince of Macchia.&lt;br&gt; In 1705 he was sent with his Neapolitan troops to Barcelona to defend the city under siege. But the city was surrendered and Pópoli was allowed to leave the city with his troops.