Portugal became a staunch ally of Great Britain. Portugal was invaded by Marshal Junot’s French army in 1808. Spain had been bullied by Napoleon into letting this small French army pass through Spain into Portugal. The British army expelled Junot after the battles of Rolica and Vimiero.
The British reformed and retrained the Portuguese to fight in the British style of 2 ranks. They became an effective part of the British army in the Peninsular.
Some of the Portuguese units accompanied Wellesley (later Lord Wellington) on his campaigns through Spain and into France. Some operated independently.