Brazil is the biggest nation in both South America and Latin America, formally known as the Federative Republic of Brazil. Brazil is the world's fifth-largest nation by size and sixth-most populated, with 8.5 million square kilometers (3,300,000 square miles) and over 211 million inhabitants. Brasilia is the capital, while So Paulo is its most populated city. The merger of the 26 states and the Federal District constitutes the federation. It is the biggest country in the Americas to have Portuguese as an official language; it is also one of the most cosmopolitan and ethnically varied countries, owing to nearly a century of huge immigration from all over the globe; and it is the most populated Roman Catholic-majority country.
Brazil has a 7,491-kilometer coastline that is bounded on the east by the Atlantic Ocean (4,655 mi). Except for Ecuador and Chile, it borders every other country and territory in South America and accounts for 47.3 percent of the continent's land area. Its Amazon basin has a large tropical forest that is home to various fauna, biological systems, and enormous natural resources spread across several protected areas. Brazil is one of 17 megadiverse nations, and its unique natural legacy is the topic of major worldwide attention since environmental deterioration via processes such as deforestation has direct consequences for global concerns such as climate change and biodiversity loss.
Prior to the arrival of explorer Pedro Alvares Cabral in 1500, who claimed the country for the Portuguese Empire, Brazil was populated by a number of tribal groups. Brazil remained a Portuguese territory until 1808 when the empire's capital was moved from Lisbon to Rio de Janeiro. When the United Kingdom of Portugal, Brazil, and the Algarves was formed in 1815, the colony was promoted to the status of a kingdom. The Empire of Brazil, a unified state administered by a constitutional monarchy and a parliamentary system, gained independence in 1822. The construction of a bicameral legislature, presently known as the National Congress, resulted from the approval of the first constitution in 1824. Following a military coup, the nation became a presidential republic in 1889. An authoritarian military junta took control in 1964 and reigned until 1985 when civilian government was restored. Brazil's current constitution, drafted in 1988, establishes the country as a democratic federal republic. The nation ranks twelfth in the world in terms of the number of UNESCO World Heritage Sites due to its rich culture and history.
Brazil is a regional and intermediate power, as well as a rising power. It is considered an advanced developing economy, with the world's twelfth biggest nominal GDP and eighth-largest PPP GDP, the largest in Latin America. Brazil, classified by the World Bank as an upper-middle-income economy and a newly industrialized nation, has the highest proportion of global wealth in South America and is one of the world's main breadbaskets, having been the top producer of coffee for the previous 150 years. However, there is still significant corruption, crime, and socioeconomic inequality in the nation. Brazil is a founding member of the UN, the G20, BRICS, Mercosul, the Organization of American States, the Organization of Ibero-American States, and the Community of Portuguese Language Countries.