Social conditions are harsh in the big cities Rio de Janeiro and Sao Paulo, where a third of the population lives in favelas, or slums.
A drive to move settlers to the Amazon region during military rule in the 1970s caused considerable damage to vast areas of the rainforest. The high rate of destruction of the Amazon by loggers and cattle ranchers remains controversial, but government-sponsored migration programmes have been halted.
Brazil's Aids programme has become a model for other developing countries, having succeeded in stabilising the rate of HIV infection and cutting the number of Aids-related deaths. It is a controversial programme, however, since it involves bypassing the big drugs firms to produce generic copycat Aids medicines
President: Luiz Inacio Lula da Silva
Luiz Inacio Lula da Silva, a former shoeshine boy and metal worker, became Brazil's first left-wing president in four decades when he beat his government-backed rival by a wide margin in the October 2002 elections. Celebrations broke out across Brazil, with supporters of the man popularly known as Lula saying they now had real hopes of a better life for all Brazilians. At his inauguration, he promised to make ending hunger his main goal during his presidency.
Lula also pledged to tackle corruption and Brazil's economic woes, improve education and create jobs. But he warned that it might not be possible to fulfil his campaign promises in his initial four-year term.
Though hailed by his supporters as a working-class hero, business leaders and investors have traditionally been wary of Lula. In his fourth attempt to win the presidency, he toned down his rhetoric and emphasised that he and his party had moved closer to the political centre. He also pledged to meet targets set by the International Monetary Fund.
Lula oversaw a stabilisation of the economy during his first six months in office, surprising some of his critics.
Lula was born in 1945 in the impoverished northeast of Brazil. His family moved to Sao Paolo when he was seven and he left school at 14 to become a metal worker.
In the 1970s, Lula honed his political skills as a fiery union leader in the industrial suburbs of Sao Paolo. He went on to help found the left-wing Workers' Party.
South America's biggest media market is home to thousands of radio stations and hundreds of TV channels.
Media ownership is highly concentrated. Home-grown conglomerates such as Globo, Brazil's most-successful broadcaster, dominate the market and run TV and radio networks, newspapers and pay-TV operations.
Brazilian-made dramas and soaps are exported to TV markets around the world. Game shows and reality TV also garner huge audiences.
Brazil's constitution guarantees a free press and vigorous media debate about controversial political and social matters is common.