The Amazon region was inhabited since 9000 BC by communities of farmers, fishermen, hunters and ranchers. In the 15th century. AD there were about four million Indians who lived there. In April 1500 the coasts of Brazil were reached by the Portuguese navigator P. Alvares Cabral, and the region was claimed and obtained by Portugal as falling within its area of relevance according to the treaty of Tordesillas of 1494. After the expedition of Martim Afonso de Sousa (1531-33) and the completion of the reconnaissance of the Atlantic coast, King John III started the colonization of the country, dividing it into 12 feudal captains, destined to increase in number. In 1549 the administration was centralized with the creation of the General Government of the Brazil, but the captaincy system remained in force until the 18th century, providing the basis for the population of the country and the formation of an aggressive and enterprising class of settlers. From the middle of the 16th century. the Jesuits started the evangelization of the indigenous, providing the first nucleus of scholars of their languages and creating important missions in the interior, where the indigenous peoples enjoyed a certain autonomy and, above all, were saved from enslavement by the settlers. Hence the hostility of the latter towards the Jesuits, the attacks of the Bandsiras (➔ Bandsirantes) to the missions and the massive importation of slaves from Africa, phenomena that continued until the 18th century. During the union between Portugal and Spain (1580-1640) the Brazil was negatively affected by European political events and suffered the development of English piracy, the French occupation of Maranhão (1612-15) and the Dutch occupation of Bahia (1624-45)). For Brazil history, please check areacodesexplorer.com.
From the end of the 17th century. the discovery of metal and precious stone mines in the southern regions caused a notable internal emigration and a new influx of Portuguese, resulting in conflicts, but also with a more intense exploration of the country. At the same time there was a growth in agricultural production, the prohibition for foreigners to own goods or to trade was lifted, land ownership reforms were introduced and the captaincy system was progressively superseded. In 1777 the treaty of S. Idelfonso put an end to a centuries-old dispute with Spain by assigning to the latter the colony of the Sacramento, founded in 1679 by the Brazilians on the banks of the Rio della Plata. The French invasion of Portugal (1807), which forced the regent Don Giovanni to take refuge in Brazil with his court (1808), leaving the defense of the country to England, created the conditions for a growth in the spirit of independence of Brazil. The opening of ports to English ships favored the development of production and trade, but the expenses for the maintenance of the Portuguese court and for the war against France impoverished the treasury and determined, with the increase in the tax burden, serious discontent.
In 1816 Don Giovanni was proclaimed king (John VI) of the united kingdom of Portugal, Brazil and the Algarve (under the English regency until 1820) but, forced by the Portuguese revolution of 1820 to return to Portugal, he lost the Brazil, who he had remained under the regency of his son Don Pedro. In fact, in 1822 he proclaimed the independence of Brazil and was crowned emperor (Peter I), receiving Portuguese recognition in 1825. Despite the relatively liberal Constitution promulgated by Peter I in 1824, the first years of life of the new state were convulsive. After the rebellion of the Cisplatina province, which gained independence as the Republic of Uruguay, the emperor was forced to abdicate in 1831, following a popular uprising flanked by the army, leaving the throne to his son Peter II, just 6 years old.. The crisis worsened in the following years, with a series of revolts that jeopardized the very unity of the country, recovering only after the proclamation of the age of majority of Peter II (1840). The reign of Peter II (1840-89) was a period of growth and modernization: explorations in the interior were resumed, agricultural production was intensified, the first railways created and the merchant navy developed; a vast stream of immigration from Europe began. Peace with foreign countries was disturbed by the war against Paraguay (1865-71), in which Brazil, allied with Argentina and Uruguay, was victorious. The main social and political problem, starting in 1860, was the issue of slavery. The country pressed for its abolition, while the landlord class opposed it, and when, after a series of partial measures, the emancipation of the slaves was decided, in the absence of the emperor, by the daughter and regent Isabella (1888), the loss of support for the crown by this class contributed to the fall of the monarchy. A military revolt in 1889 led to the abdication of Peter II and the proclamation of the Republic, whose first president was Deodoro da Fonseca. In 1891, a federalist constitution was launched, modeled on the model of the US one; but the situation, after the dictatorial government of the first (military) presidents, stabilized only from 1895.