He saw action at the Battle of Roliça on 17 August 1808, at the Battle of Vimeiro on 21 August 1808, where he was wounded, and at Corunna on 16 January 1809 where he was by the side of Sir John Moore when the latter was killed. He was promoted to major on 13 April 1809 and appointed deputy-quartermaster-general in the Portuguese army and was present at many of the battles of the Peninsular War. Promoted to lieutenant-colonel in 1811, he saved the day for the British at Battle of Albuera on 16 May 1811 by taking responsibility at a critical moment and strongly urging General Cole's division to advance. He took part in the Battle of Vitoria on 21 June 1813, where he was wounded again, and was also present at the Battle of the Pyrenees in July 1813 and the Battle of Nivelle on 10 November 1813. He commanded the Portuguese brigade at the Battle of Orthez on 27 February 1814 and the Battle of Toulouse on 10 April 1814. He was appointed Knight Commander of the Order of the Bath in January 1815.