The captaincy remained under the influence of Coutinho's family for 140 years. It was elevated to province status in 1821, following the 1815 elevation of Brazil to a constituent kingdom of the United Kingdom of Portugal, Brazil, and the Algarves, prompted by the 1808 transfer of the Portuguese court to Brazil. The Portuguese court were fleeing the Napoleonic Invasion of Portugal (1807).