Brazil country profile
Brazil is South America's most influential country, a rising economic power and one of the world's biggest democracies.
Over the past few years it has made major strides in its efforts to raise millions out of poverty, although the gap between rich and poor remains wide.
The exploitation of the Amazon rainforest, much of which is in Brazil, has been a major international worry, since the wilderness is a vital regulator of the climate.
A former Portuguese colony, Brazil has a highly diverse population, including indigenous Americans and the descendants of African slaves and European settlers.
Federative Republic of Brazil
Capital: Brasilia (largest city: Sao Paulo)
Population 208 million
Area 8.55m sq km (3.3m sq miles)
Major language Portuguese
Major religion Christianity
Life expectancy 72 years (men), 79 years (women)
President: Michel Temer
Michel Temer was sworn in as president in August 2016 after senators voted to remove Dilma Rousseff from office over financial irregularities.
His inauguration brought to an end the 13-year rule of Ms Rousseff's left-wing Workers' Party.
Once political allies, Mr Temer served as vice-president in Ms Rousseff's government for over five years before playing a key role in impeachment proceedings against her.
Mr Temer pledged to bring back "political stability" to the recession-stricken country, but austerity measures and failed attempts to impeach him on corruption charges left the country divided.
President-elect: Jair Bolsonaro
Retired army officer Jair Bolsonaro won a decisive victory over the centre-left Workers' Party in the October 2018 presidential election.
A member of the Social Liberal Party, an anti-establishment group that combines social conservatism and pro-market policies, Mr Bolsonaro is a deeply polarising figure whose earlier defence of the military dictatorship has alarmed many Brazilians.
But after his win he has tried to assure voters that he will "defend democracy" and uphold the constitution.
Mr Bolsonaro's promise to "cleanse" Brazil of corruption proved particularly popular in a country that has seen dozens of politicians from the mainstream parties jailed.
Among his flagship policies are a relaxation of gun laws to allow "every honest citizens" to own a firearm, a cut in state intervention in the economy, and the possibility of withdrawal from the 2015 Paris climate change agreement.
He takes office on 1 January 2019.
Read full profile
Television dominates South America's biggest media market.
Media ownership is very concentrated and corporate giants such as Globo are the main players in broadcasting and the press.
The constitution guarantees a free press and there is vigorous political debate in the media. But freedom groups say Brazil is one of the region's most violent countries for journalists.
Around 50% of Brazilians are online. They are among the world's most enthusiastic users of social media.
- Read full media profile
1500 - Portuguese land in the area and claim it for the Portuguese crown.
1822 - The son of the Portuguese king declares independence from Portugal and crowns himself Pedro I, emperor of Brazil.
1888 - Slavery is abolished. A year later, Brazil's monarchy is overthrown and a federal republic is established; in subsequent decades, government is dominated by European coffee plantation owners.
1930 - Nationalist and anti-communist Getulio Vargas comes to power in a coup; his 15-year authoritarian rule pursues state-led industrialisation and improvements in social welfare.
1945 - Vargas toppled by a coup that restores democratic rule and ushers in the second Brazilian Republic.
1960 - The capital is moved from Rio de Janeiro to the new purpose-built city of Brasilia.
1964 - Left-wing President Joao Goulart is ousted in a coup that commences two decades of military rule; the regime stifles freedom of speech and tortures opponents, but also pursues economic development.
1985 - Return of civilian government.
2002 - Luiz Inacio Lula da Silva, popularly known as Lula, wins elections to become Brazil's first left-wing president for more than 40 years.
2016 - Lula's ally and successor Dilma Rousseff - is removed as president after an impeachment trial finds her guilty of financial irregularities.
2018 October - Far-right candidate Jair Bolsonaro wins presidential election over Workers' Party candidate.
- Read full timeline