In a world that has forever closed the Middle Ages, fundamentally rural, the new millennium began under the sign of urban development. This development was created around the walled fences of the medieval castles and of these went to the conquest of surrounding grounds.
Castro Marim did not escape the rule and became one of the villages that were generated around an element, the Castle, widening by the valley that separates it from the Hill of the Cabeço, where later the Fort of San Sebastián was implanted.
In the 16th century, a hermitage, known as Our Lady of the Martyrs, appeared in the 16th century due to the incapacity of the town's Mother Church, inside the walls, to house all the faithful. This Hermitage was visited several times during the 16th century by the Order of Santiago, which had its headquarters in Castro Marim Castle between 1319-1356, the year in which it moved to the town of Tomar.
The visits of the Order of Santiago describe the Hermitage as having a single body, with a vaulted main chapel with a corusse and an altar in masonry with a tribune, where an image of a figure of Our Lady and the Child was set in stone; in the body of the Hermitage, of a single nave, were three painted images, one of S. Bartolomeu, one of Sta. Catarina and another of S. Sebastião; it had a main portal to the west and another to the south, each with two sinks of holy water embedded in the masonry wall; an altar, around the said Ermida, where the dead were buried.
From the register of visits - Visits - from 1518 to 1534, this hermitage was added by a porch to the west, sheltering the main portal, following the entire south facade. The Visitation of 1554 gives it the location of the sacristy, which before was not focused, to the south with a straight cock. The Visitation of 1565 denounces an increase in the height of the walls, the replacement of the wood of the ceilings with new ones, and the addition of a new porch, from the main façade to the wall of the sacristy.
After the 1755 earthquake, responsible for the destruction of Santiago's Mother Church, this hermitage became a parish church, built by Lopo Mendes de Oliveira, Commander of the Order of Christ and Alcaide of this Castle.
Due to its small size, it was ordered to be restored and expanded between the late eighteenth and early nineteenth century, and the works were completed in 1834, under the responsibility of the architect João Lopes do Rosário.
Denounces in its architecture several architectonic campaigns of great interest: Renaissance galileo; the dome and vaulted ceiling of baroque chapels; Neo-Solanian elements in the platibanda that overlaps the galilee.
It has a longitudinal plant of single nave, choir-top with balustrade of belly in wood, transept and chancel of two sections; the main façade, to the west, is tripartite, with a main portal with a straight dorsal line, surmounted by a pediment with triangular tympanum, topped with a rectangular window and a circular clock with gable roof with iron cross at the top; on the south façade, Galileo with five arched arches of perfect turn set in colonnades of neomanueline capitals, where there is a panel of blue and white tiles, evoking Our Lady of the Conception. It owns several examples of imagery of the sixteenth and eighteenth centuries, in wood, as well as altarpieces on the main altar and transept in marble and polychrome wood.
It distributes this Matrix with the Castle, to the north, and the Fort of São Sebastião, to the south, the frame that composes the image of Castro Marim, denouncing the simple lines of all the surrounding house.