Answer
The de facto end of the United Kingdom of Portugal came in 1822 with the Brazilian Declaration of Independence. Brazil, then the larger and wealthier part of the dual monarchy, unilaterally proclaimed its independence under its own emperor, Pedro I, son of King João VI of Portugal. This effectively shattered the political unity of the United Kingdom, though diplomatic recognition of Brazil's independence took several years.