Gaspar de Lemos set sail from Portugal for Brazil in 1501 and entered a huge bay in January 1502. Mistaking it for a river, he named it Rio de Janeiro. It was the French, however, who first settled permanently here. The Portuguese, like the French, harvested brazil wood along the Brazilian coast, and as Portuguese colonization began to take hold, the French became concerned about being pushed out.
In 1555 three ships full of French settlers reached the Baía de Guanabara and settled on a small island they called Antarctic France. It didn't take long for the weak new town to come under attack from the Portuguese, who finally expelled the French from the region in 1560. They also drove out the powerful Tamoio Indians, who'd allied themselves with the French, in a series of grisly battles.
The founding Cariocas set up a fortified town on the Morro Castelo in 1567 called São Sebastião do Rio de Janeiro. It was a typical Brazilian town: poorly planned, with irregular streets in medieval Portuguese style. By the end of the century the settlement was getting by on fishing and exporting obrazil wood and sugar cane. In 1660 the population was made up of 3000 Indians, 750 Portuguese and 100 blacks, and was Brazil's third most important settlement. Slaves were brought in and sugar plantations - and their owners - thrived.
A gold rush in Minas Gerais at the start of the 18th century - ending half a century later when the gold ran out - changed Rio forever, and it became the prize of Brazil. In 1710 the French, who were raiding the Portuguese colonies, attacked the city. They failed at first, but on their second try succeeded, prompting the entire population to flee the city in the night. The French demanded sizeable piles of gold, sugar and cattle, and the Portuguese had no choice but to oblige. However, the victorious French were brought down a few notches when two of their returning ships, filled with gold, were lost in treacherous storms.
Rio bounced back, replacing Salvador de Bahia as the colonial capital in 1763. In 1808 the entire Portuguese monarchy and court arrived in Rio, and so it was that the city came to house what was left of the Portuguese Empire. With the court came a heap of money and skills that were used to build some of the city's lasting monuments. The coffee boom in the mountains of São Paulo and Rio revitalized the economy, and the city took on a new importance as a port town and commercial center. Passenger ships began sailing to London in 1845 and to Paris in 1851, and by the end of the 19th century, the city's population exploded due to European immigration and internal migration.
The period between the early 1920s and the late 1950s was Rio's golden age. With the inauguration of the grand hotels (the Glória in 1922 and the Copacabana Palace in 1924), it became a romantic, exotic destination for Hollywood celebrities and international high society who came to play and gamble at the casinos and dance or perform in the nightclubs.
Rio continued to change. Three large landfill projects were undertaken to ease the strain on a city restricted by its beautiful surroundings. The first was to become Aeroporto Santos Dumont, near Centro. The second resulted in Flamengo Park, and the third expanded the strand at Copacabana.
Rio remained the political capital of Brazil until 1960, when the government moved to Brasília. During the 60s, modern skyscrapers rose in the city, and some of Rio's most beautiful buildings were lost. During the same period, the favelas (shanty towns) of Rio grew to critical mass, with immigrants from poverty-stricken areas of the northeast and interior swelling the number of the city's urban poor. The Cidade Maravilhosa (Marvelous City) began to lose its gloss as crime and violence increased.
The final decade of the military dictatorship that ruled Brazil from 1964 to 1985 was not kind to Rio. There were numerous protests during that period (notably in 1968 when some 100,000 marched upon the Palácio Tiradentes). Even Rio's politicians opposed the military regime, which responded by withholding vital federal funding. The administration was forced to tighten its belt, and infrastructure deteriorated as the city's coffers dried up.
A turning point came when Rio was chosen as host city for Eco 92, the United Nations Conference on Environment and Development. In the build-up to the conference, the federal government poured in almost one billion US dollars to improve the city's infrastructure. Millions were spent on satellite communications alone, and Riocentro, a huge convention center, was built.
Today Rio's coffers are full, and the city is buzzing with an unstoppable creative energy, as long-awaited projects are finally being financed. The biggest is the Favela-Bairro project, which strives to integrate favelas into the rest of the city by providing basic sanitation and planning leisure areas, health clinics, schools, preschools and community centers (Rio has pledged a total of one billion US dollars over the life of the project). At the same time, some of the city's ageing colonial gems are slowly being revitalized, with the arrival of new businesses.