Lisbon
Lisbon (; , ) is the capital and the largest city of Portugal, with an estimated population of 505,526 within its administrative limits in an area of 100.05 km. Its urban area extends beyond the city's administrative limits with a population of around 2.8 million people, being the 11th-most populous urban area in the European Union. About 3 million people live in the Lisbon Metropolitan Area (which represents approximately 27% of the country's population). It is mainland Europe's westernmost capital city and the only one along the Atlantic coast. Lisbon lies in the western Iberian Peninsula on the Atlantic Ocean and the River Tagus. The westernmost areas of its metro area form the westernmost point of Continental Europe, which is known as Cabo da Roca, located in the Sintra Mountains.
Portugal
In 1807, as Napoleon's army closed in on Lisbon, the João VI of Portugal, the Prince Regent, transferred his court to Brazil and established Rio de Janeiro as the capital of the Portuguese Empire. In 1815, Brazil was declared a Kingdom and the Kingdom of Portugal was united with it, forming a pluricontinental State, the United Kingdom of Portugal, Brazil and the Algarves.
As a result of the change in its status and the arrival of the Portuguese royal family, Brazilian administrative, civic, economical, military, educational, and scientific apparatus were expanded and highly modernized. Portuguese and their allied British troops fought against the French Invasion of Portugal and by 1815 the situation in Europe had cooled down sufficiently that João VI would have been able to return safely to Lisbon. However, the King of Portugal remained in Brazil until the Liberal Revolution of 1820, which started in Porto, demanded his return to Lisbon in 1821.