Sous-lieutenant in the régiment de Touraine, he served in the Seven Years' War as an officer in Le Royal-Italien, and remained in that unit for the Corsican campaign of 1769.
By his marriage on 8 August 1780 to Jacquette Pailhoux de Cascastel (daughter of a Conseiller souverain of Le Roussillon), he became master of the forges and formed a company to exploit the mines at Les Corbières and Le Razès under the jurisdiction of the abbey of Lagrasse with his cousin, Jean-Pierre François Duhamel, correspondent of the Académie des sciences and commissaire of Louis XVI for mines and forges.
He repulsed a Spanish attack on this position on 19 May but was still forced to abandon it, though he then stopped an enemy column of 6,000 men marching on Perpignan.
Made commander in chief of the Armée centrale des Pyrénées after de Flers was removed from this post, he seized Puycerda on 29 August 1793 and the whole of the Spanish Cerdagne within 24 hours, before defeating the Spanish again on 4 September 1793 at Mont-Louis, capturing 14 cannon and recapturing part of Le Roussillon.
Arriving back at Perpignan in March 1794, he could not obtain some battalions from Dugommier (12,000 infantry and 600 cavalry in total) which had been put at his disposal.