With the occupation by Napoleon, Portugal began a slow but inexorable decline that lasted until the 20th century. This decline was hastened by the independence in 1822 of the country's largest colonial possession, <answer>Brazil</answer>. In 1807, as Napoleon's army closed in on Lisbon, the Prince Regent João VI of Portugal transferred his court to <answer>Brazil</answer> and established Rio de Janeiro as the capital of the Portuguese Empire. In 1815, <answer>Brazil</answer> was declared a Kingdom and the Kingdom of Portugal was united with it, forming a pluricontinental State, the United Kingdom of Portugal, <answer>Brazil</answer> and the Algarves.
To where did Prince Regent Joao VI of Portugal transfer his court?
Brazil