He fought against the French in the Peninsular War, where he raised a corps of volunteers in the north and was later military governor of Vila Real. For his services, he received the title of Viscount of Santa Marta in 1823.
In 1824, he played an important role in the April Revolt and in 1828 at the outbreak of the civil war, he joined the Miguelist camp.
In 1832, he directed the Miguelist forces at the Siege of Porto, together with General Póvoas. Because of his prudent approach and rivalry with General Póvoas, he was relieved of command in February 1833. He retreated from public life and died in 1844.
He was succeeded as Viscount of Santa Marta by his son José de Sousa Pereira de Sampaio Vaía, who also fought at the Siege of Porto, and who died without children in 1847.