During which war was Brazil last invaded ?
In March 1826 , João VI died and Pedro I inherited the Portuguese crown , briefly becoming King Pedro IV of Portugal before abdicating in favor of his eldest daughter , Maria II .