The son of a military family, he served in the Peninsular War against Napoleon as an officer in the first battalion of the "Leal Legião Lusitana", serving in the battles of Albuera, Bussaco, Nive, Nivelle, Salamanca, Vitoria, Orthez and Toulouse, for several of which he was decorated.