The Napoleonic Wars also led to the severing of the direct links between Portugal and its only American colony, Brazil. Days before Napoleon invaded Portugal, in 1807 the Portuguese royal court fled to Brazil. In 1820 there was a Constitutionalist Revolution in Portugal, which led to the return of the Portuguese court to Lisbon. This led to distrust between the Portuguese and the Brazilian colonists, and finally, in 1822, to the colony becoming independent as the Empire of Brazil, which later became a republic.