He did the whole Campaign of Banda Oriental, distinguishing himself in the Battle of Paço de Arenas in September 1819. In 1821, in Brazil, he was given the rank of Lieutenant-General, due to his appointment as Governor of Arms of the Court and Province of Rio de Janeiro, controlling the riots which had been occurring because of the departure of King John VI and the court.