Although independence had been easily achieved, the early decades of empire proved much more difficult. The first problem was Dom Pedro himself: headstrong and autocratic, he became increasingly estranged from his subjects, devoting more attention to scandalous romances than affairs of state. In April 1831 he abdicated, in a fit of petulance, in favour of the heir apparent,
Dom Pedro II
, and returned to Portugal. Pedro II would later prove an enlightened ruler, but as he was only five at the time there were limits to his capacity to influence events. With a power vacuum at the centre of the political system, long-standing tensions in the outlying provinces erupted into revolt.
There were common threads in all the
rebellions
in the provinces: slaves rebelling against masters, Indian and mixed-race resentment of white domination, Brazilians settling scores with Portuguese, and the poor rising against the rich. The first, and most serious, conflagration was the
Cabanagem Rebellion
in Pará, where a mass revolt of the dispossessed began in 1835. The rebels took Belém, where, in a great moment of retribution, the Indian Domingues Onça killed the governor of Pará. The uprising spread through the Amazon like wildfire and took a decade to put down. A parallel revolt, the
Balaiada
, began in Maranhão in 1838. Here the rebels took Caxias, the second city of the state, and held out for three years against the army. Similar risings in Pernambuco, Bahia and Rio Grande do Sul punctuated the 1830s and 1840s; the disruption was immense, with large areas ravaged by fighting which threatened to tear the country apart.
The crisis led to Dom Pedro II being declared emperor four years early, in 1840, when he was only fourteen. Precociously talented, he was a sensible, scholarly man, completely unlike his father. His instincts were conservative, but he regularly appointed liberal governments and was respected even by republicans. With government authority restored, the provincial rebellions had by 1850 either blown themselves out or been put down. And with
coffee
beginning to be planted on a large scale in Rio, São Paulo and Minas, and the flow of European immigrants rising from a trickle to a flood, the economy of southern Brazil began to take off in earnest.