Main portal of Igreja da Graça
The Tagus River as seen from Portas do Sol
Since prehistory, the region of Santarém has been inhabited, first by the Lusitani people and then by the Greeks, Romans, Visigoths, Moors and later Portuguese Christians. Of the various legends related to the foundation of Santarém, the most famous tells of the Visigoth Saint Iria (or Irene), who was martyred in Tomar (Nabantia) and whose uncorrupted body reached Santarém. In her honour, the name of the town (then known by its Latin name Scalabis) would later be changed to Sancta Irene, from which Santarém would eventually be derived.
The foundation of the city is attributed to the Romans, who occupied the region in the 2nd century BC and named the city Scalabis. During the Roman period Scalabis was an important commercial post in the mid-Tagus region and was the administrative capital of one of the regions (Conventus Scalabitanus) of Lusitania. Julius Caesar ordered the creation of a military camp in Santarém in 61 BC. The city takes at this time the designation of Scallabis Praesidium Iulium.
The 3rd century crisis and the decline of the Western Roman Empire affected the civitas and in the 5th century the town was conquered by Germanic tribes (Vandals and Alans). In 460, the Visigoths, led by Sunerico, conquered the city and expelled the Alans.
After the period of Visigoth domination, Santarém was taken in the 8th century by the Moors, who named it Shantarin. Under the rule of the Moors the city became an important cultural centre. Important Moor personalities born in Santarém include the poet and historian Ibn Bassam (died 1147) and the poet
Ibn Sara (1043–1123).
The period of Moorish domination was finished in 1147 by the first King of Portugal, Afonso Henriques, who conquered the city on March 15. According to period chronicles, the King and a small army managed to take the city after some men climbed the walls during the night and opened the gates. The story of the conquest of Santarém is told in a heroic tone in the medieval chronicle De expugnatione Scalabis, which celebrates and justifies the power of the first Portuguese King. From a military point of view, the conquest of Santarém and, in that same year, of Lisbon were crucial steps in the Reconquista of Portugal.
The most notable Almohad ruler, Abu Yaqub Yusuf (patron of Averroes and Ibn Tufail), died in Santarém while trying to recapture it during the siege of 1184.
After the reconquest of Santarém, the city was frequently visited by the successive monarchs and many feudal parliaments (Cortes) were held in Santarém. King Fernando I, in particular, was very fond of the city and chose to be buried in the Convent of Saint Francis (Convento de São Francisco). His tomb is now in the Carmo Museum in Lisbon. The city was one of the most important in medieval Portugal, as attested by its large number of monasteries and its royal palace (no longer in existence but was located where the Cathedral currently stands). There are still enough examples of Gothic buildings in the city for it to be known as the "Capital of the Portuguese Gothic".
In the 15th century, during the period of Portuguese discoveries, expeditions like the conquest of Ceuta (1415) were planned in the royal palace of Santarém. Many important personalities related to this historical time are buried in the churches of Santarém. Pedro de Meneses, first governor of Ceuta (1415–1437) after the Portuguese conquest, is buried in a magnificent Gothic tomb in the Church of the Grace (Igreja da Graça). In the same church is also buried Pedro Álvares Cabral, the navigator that discovered Brazil in 1500.
The city was hit by earthquakes twice: one in 1531 and the other in 1755, which damaged the city and many historical monuments were lost. During the Napoleonic invasions in the early 19th century the city was invaded and pillaged.
In the second half of the 19th century many improvements reached Santarém, like running water, gas light, the building of a bridge over the Tagus and the railway in 1861. In the 20th century, the infrastructure of the city (education, housing, commerce) continued to improve and the economy of the city remained mainly dedicated to the production of agricultural goods.