Due to his headstrong and autocratic nature (coupled with numerous sex scandals), Pedro I’s imperial reign was short-lived. In 1824, he presided over the creation of Brazil ’s first constitution and, in theory, accepted his status as constitutional monarch. In practice, just as he had refused to cooperate with Portugal’s government, he wouldn’t share power with Brazilian members of parliament. When increasingly pressed to do so, he once again lost his temper and abdicated.
In 1831, he returned to Portugal, leaving Brazil in the hands of his 5-year-old son, Pedro II. Without a strong leader in charge, over the next decade revolts broke out throughout the country, from Pará  and Maranhão  in the north to Rio Grande do Sul . Brazilians fought against Portuguese loyalists, slaves rebelled against their masters, the poor rose up against the privileges of wealthy landowners.
Faced with the risk of the country being torn apart, Pedro II was quickly crowned emperor in 1840. Although only 14, Dom Pedro II was a highly intelligent, progressive, and judicious leader who was admired by both the conservative elite and the more liberal republicans. His authority quickly quelled the regional uprisings, and under his long reign Brazil enjoyed growth and stability.
During this time, the Southeast definitively eclipsed the Northeast in importance, spurred on by Rio ’s political and cultural importance and the beginning of the lucrative coffee boom, which brought a flood of European immigrants to the fertile hills of Rio de Janeiro , São Paulo , and Paraná  as well as to the cities of the South.