The train was then landed at Ostend after the Battle of Landen and put under Charles Schomberg, with whom it helped capture Veurne, Diksmuide and Ghent.
Petit embarked from Gibraltar on 28 July 1705 on ships commanded by Sir Cloudesley Shovell and landed his troops at Barcelona on 22 August.
Petit was promoted colonel and took part in the battle of Almanza before preparing Tortosa for a siege, though he was unable to hold it against the Duke of Orleans and surrendered on 10 July 1708.
He was quickly the subject of another prisoner exchange and became chief engineer to General Stanhope on the Minorca Expedition of August 1708, capturing Port Mahon and being appointed governor of its citadel and lieutenant-governor of the island.
When peace came he was put in charge of a home establishment of engineers and then in September 1714 assigned to Scotland to assist General Maitland against a threatened rising by the Highland Clans.