From 1807 to 1811 Napoleonic French forces invaded Portugal three times. As a result, the Portuguese royal family was transferred to the Portuguese colony of Brazil, where it remained until 1821. From Brazil, the Portuguese king João VI ruled his transcontinental empire for thirteen years.