Humans have inhabited the area covered by modern-day Brazil since at least 9000 BC; it hosted a population of between 2 and 6 million at the time settler populations arrived. The first Europeans to reach Brazil sighted it by accident in 1500, after drifting farther west than intended whilst on a voyage to India via the Cape of Good Hope. The Portuguese explorers claimed the land and established settlements along the coast, followed by a colonial government based in Salvador, in Bahia, from 1549.
Colonial-era buildings in Salvador, Bahia, the seat of the first colonial government in Brazil.
By the end of the sixteenth century, the colonial economy was dominated by sugarcane plantations fuelled by slave labour. Between five and six million enslaved black workers were brought over from Africa, and tens of thousands more were captured from the indigenous populations. Armed expeditions called bandeiras into the interior of the country, in search of gold, gems, and yet more enslaved workers, gradually pushed the boundaries of Brazil westward. These depredations, together with the diseases brought in by settlers and spread throughout the country by missionaries, decimated the indigenous population.
The discovery of gold in Minas Gerais (‘Widespread Mines’) led to a gold rush in the eighteenth century. Prospectors headed south, bringing nearly a million enslaved workers with them to work in the new mines. As more people and money flooded into the southeast of the country, the capital was moved to Rio de Janeiro in 1763.
In 1807 the Portuguese court, threatened by the Napoleonic wars, moved to Rio, which became the capital city of the newly formed United Kingdom of Portugal, Brazil, and the Algarves. Independence for Brazil followed not long afterwards, after the king, João VI, installed his son Pedro I as regent in Brazil and returned to Portugal.