Answer
Pedro I became king of Portugal in 1826 after the death of his father, King João VI. João VI had been forced to flee Portugal during the Napoleonic Wars and had established a government in exile in Brazil. Pedro I, who had been ruling Brazil as regent, returned to Portugal to claim the throne. He was crowned king in 1826 and ruled until his death in 1834.