Britain’s participation in the Peninsular War helped keep Portugal independent; French troops were expelled from the country. The war cost Portugal a town that Spain now governs: Olivença. Rio de Janeiro, Brazil, served as the Portuguese capital.