The records of human occupation in the county's territory date back to prehistory, having been collected, in several places, numerous traces since the Neolithic.
With the Roman presence, in the XNUMXst to XNUMXth centuries of our era, Cetóbriga was born, an important urban and industrial center, mainly linked to the salting of fish, which extended along both banks of the River Sado, integrating Troia.
During the barbarian invasions and the Arab occupation, the inhabited area was gradually abandoned due to the advance of the sands.
Watchtowers such as Palmela, more sheltered ports, such as Alcácer do Sal, and fertile valleys, such as Azeitão, were the places chosen by the Muslim invaders to settle.
After the conquest of Palmela from the Moors and the establishment of the Order of Santiago da Espada, Setúbal was repopulated, first on the hill of Santa Maria and, progressively, in the lower area that extends to the current district of Tróino.
It received, in 1249, from D. Paio Peres Correia, master of the Order, the first charter.
Setúbal, with a relatively small territorial extension, had to assert itself, fighting with the neighboring municipalities of Palmela, Santiago do Cacém and Alcácer do Sal, already constituted at that time.
With the difficulties presented by the inhabitants, with regard to the entry and sale of products brought from Sesimbra, Palmela and Alcácer, the master of Santiago, D. Garcia Peres, in 1343, carried out a letter from D. Afonso IV, which delimited the term of Setúbal, having been built a curtain of walls.
Throughout the XNUMXth century, the town developed economic activities, mainly linked to industry and commerce, earning high income from the fees charged for entering the port.
The first Franciscan convents, one of them the Convento de Jesus, were built in Setúbal during that century.
The Age of Discoveries brought great development, with D. Afonso V, in 1458, leaving the port of Setúbal to conquer Alcácer Ceguer.
The construction of an aqueduct, in 1487, which carried water to the village, started by D. João II, ended in the reign of D. Manuel. This monarch reformed the town's charter in 1514, due to the progress and demographic increase that Setúbal had registered over the last century.
The title of “notable villa” is granted, in 1525, by D. João III. It was this title that led to the creation, in 1553, by letter of the Archbishop of Lisbon, D. Fernando, of two new parishes, S. Sebastião and Anunciada, which joined the already existing S. Julião and Santa Maria.
About two kilometers from the center of Setúbal, King D. Filipe II ordered the construction of a fortress – of S. Filipe –, whose work began in 1582.
At the beginning of the XNUMXth century, the population of Setubal requested that S. Francisco Xavier be elected patron of the city.
The 1755 earthquake destroyed and damaged many buildings, with the parishes located in the lower part of Setúbal being the most affected.
Throughout the XNUMXth century, economic and social development transformed the town into one of the most important commercial and industrial centers in the country.
The elevation to the city took place in 1860, by royal charter, after a request from the Chamber, two years before, to King D. Pedro V. At that time, the Barreiro/Setúbal railroad was inaugurated and, in 1863, the lighting to gas. Landfill works over the river began, giving rise to Avenida Luísa Todi.
Setúbal was elevated, in 1926, to the district seat and, in 1975, to the head of diocese.