He was promoted to Cavalry brigadier in 1798 and in 1803 he was appointed military and political commanding officer for the province of Tuy, in Galicia.
Franceschi's horsemen, following close behind, caught up with and attacked La Romana's rearguard, some 1,200 bayonets, under Mahy, at Osoño, just outside Monterrei, killing 300 men and taking 400 prisoners, as well as capturing three standards.
[2] While La Romana was away, Mahy expelled the French forces from Galicia with actions at Lugo, Santiago, and at Puente Sanpayo, for which he was promoted to lieutenant general.
[1] At the beginning of 1810 Mahy had to hand over his command due to ill health and retire to La Coruña.
[1] With the Trienio Liberal and the restoration of the Constitution in 1820, Mahy was appointed captain general of Old Castile and of Cuba in 1821, post he held at the time of his death.