Before the Portuguese first arrived, the area was inhabited by the Tupinambás to the north and the Tupiniquins to the south.
Both tribes were separated by the Serra de Boiçucanga (Boiçucanga Mountain range), located 30 km south of the city centre.
Both tribes disliked each other.
When the French arrived in Brazil via the Guanabara Bay and confronted the Portuguese, the Tupiniquins united with the Portuguese and the Tupinambás, with the French.
This battle between them was witnessed and narrated by Hans Staden.

The municipality was named after Saint Sebastian because of the day that the Américo Vespúcio expedition sailed through the channel between the city and Ilhabela – January 20, 1502.

The first Portuguese to settle there were Diogo de Unhate, Diogo Dias, João de Abreu, Gonçalo Pedroso and Francisco de Escobar Ortiz, just after the division of Brazil in capitanias hereditárias.
São Sebastião was part of the Captaincy of Santo Amaro.
The place was first developed as an agriculture and fishing village.
The agricultural activities transformed the village in a major sugar cane producer, which later helped the hamlet to earn its village status on March 16, 1636.
To gain this status, though, the village had to build a church in honour of Saint Sebastian.

A few years after this, another hamlet developed just north of São Sebastião: São Francisco da Praia (Saint Francis of the Beach).
In 1840, the hamlet took the first step to become independent: they asked it to become a freguesia.
The request was eventually accepted in the same year, but the freguesia was disestablished in 1859 and re-joined to São Sebastião.

The city kept on basing its economy on the production of sugar cane, coffea, tobacco and fishing.
The local port was widely used to load ships with gold from Minas Gerais during the 17th and 18th centuries.
It was also used by pirates and smugglers.

When slavery was abolished, in 1888, and the railway linking São Paulo to the bigger Port of Santos was opened, the city's economy entered a period of crisis, and the population decreased.
From that moment on, the city began to rely on subsistence agriculture and "handicraft fishing" (Pesca Artesanal), a type of fishing done entirely by hand since the fishing until the consumption (in other words, no machinery is used, and most of the people who practice it do it for subsistence as well).

Until the 1960s, nothing much has changed.
However, in that decade, Petrobras built its oil terminal, attracting new employees and investments.
The occupation of the city became wider and faster.
While the city centre kept its development, workers from other parts of Brazil built their houses near the Serra do Mar, originating the neighborhood of Topolândia, which now concentrates the lower-class families.

São Sebastião became a tourist destination in the late 1980s, when the Rodovia Rio-Santos (a section of the BR-101 that connects Santos to Rio de Janeiro) was completed and paved.
Most of the lands were sold to countryside or paulistanas families who wished a house to spend the weekends and holidays.
Most of the caiçaras (people who make a living out of fishing) started to work with tourism, even though a few of them still earn money from fishing.

Until nowadays, tourism plays an important role in the city's economy.
However, as the city grew, proper water and sewage pipes have not been built for every building, which led to the lack of proper urban infrastructure in certain points of the city.
As of November 2010, less than 50% of the city's sewage receives proper treatment.
However, after a project by the government of the state os São Paulo called "Onda Limpa" (Clean Wave), the percentage of houses connected to sewage pipes went up to 94%, as of January 2012.

Besides, improper housing became a major problem, as more houses are built in Mata Atlântica zones which, apart from being subject to preservation, are highly likely to suffer from mudslides.
There is an estimated 11,045 houses built in "frozen" areas, that is, areas in which new houses are not allowed to be built.
The number of
Before the Portuguese first arrived, the area was inhabited by the Tupinambás to the north and the Tupiniquins to the south. Both tribes were separated by the Serra de Boiçucanga (Boiçucanga Mountain range), located 30 km south of the city centre. Both tribes disliked each other. When the French arrived in Brazil via the Guanabara Bay and confronted the Portuguese, the Tupiniquins united with the Portuguese and the Tupinambás, with the French. This battle between them was witnessed and narrated by Hans Staden.
The municipality was named after Saint Sebastian because of the day that the Américo Vespúcio expedition sailed through the channel between the city and Ilhabela – January 20, 1502.
The first Portuguese to settle there were Diogo de Unhate, Diogo Dias, João de Abreu, Gonçalo Pedroso and Francisco de Escobar Ortiz, just after the division of Brazil in capitanias hereditárias. São Sebastião was part of the Captaincy of Santo Amaro. The place was first developed as an agriculture and fishing village. The agricultural activities transformed the village in a major sugar cane producer, which later helped the hamlet to earn its village status on March 16, 1636. To gain this status, though, the village had to build a church in honour of Saint Sebastian.
A few years after this, another hamlet developed just north of São Sebastião: São Francisco da Praia (Saint Francis of the Beach). In 1840, the hamlet took the first step to become independent: they asked it to become a freguesia. The request was eventually accepted in the same year, but the freguesia was disestablished in 1859 and re-joined to São Sebastião.
The city kept on basing its economy on the production of sugar cane, coffea, tobacco and fishing. The local port was widely used to load ships with gold from Minas Gerais during the 17th and 18th centuries. It was also used by pirates and smugglers.
When slavery was abolished, in 1888, and the railway linking São Paulo to the bigger Port of Santos was opened, the city's economy entered a period of crisis, and the population decreased. From that moment on, the city began to rely on subsistence agriculture and "handicraft fishing" (Pesca Artesanal), a type of fishing done entirely by hand since the fishing until the consumption (in other words, no machinery is used, and most of the people who practice it do it for subsistence as well).
Until the 1960s, nothing much has changed. However, in that decade, Petrobras built its oil terminal, attracting new employees and investments. The occupation of the city became wider and faster. While the city centre kept its development, workers from other parts of Brazil built their houses near the Serra do Mar, originating the neighborhood of Topolândia, which now concentrates the lower-class families.
São Sebastião became a tourist destination in the late 1980s, when the Rodovia Rio-Santos (a section of the BR-101 that connects Santos to Rio de Janeiro) was completed and paved. Most of the lands were sold to countryside or paulistanas families who wished a house to spend the weekends and holidays. Most of the caiçaras (people who make a living out of fishing) started to work with tourism, even though a few of them still earn money from fishing.
Until nowadays, tourism plays an important role in the city's economy. However, as the city grew, proper water and sewage pipes have not been built for every building, which led to the lack of proper urban infrastructure in certain points of the city. As of November 2010, less than 50% of the city's sewage receives proper treatment. However, after a project by the government of the state os São Paulo called "Onda Limpa" (Clean Wave), the percentage of houses connected to sewage pipes went up to 94%, as of January 2012.
Besides, improper housing became a major problem, as more houses are built in Mata Atlântica zones which, apart from being subject to preservation, are highly likely to suffer from mudslides. There is an estimated 11,045 houses built in "frozen" areas, that is, areas in which new houses are not allowed to be built. The number of 
São Sebastião, São Paulo