During the period of the Restoration Wars (1640), with the struggles around the frontier squares regaining their importance, Castro Marim returned to a larger increase than he had previously lost, and with this the Holy House of Mercy acquired new importance.
By this time other bastions arose, in one of which was the Chapel of San Sebastián, devastated during the works of the Fort, to which it gave the name.
In order that the village should not be deprived of a temple, Dom João IV ordered a chapel to be invoked by the same saint, in 1650, as the inscription above the main portal says: "this hermitage of S. Sebastião ordered the king to do King João IV for taking another strong pear.Anno of 1650. "
This new temple located next to one of the entrances of the village, became the new Misericórdia church and the institution moved there in 1838.
The new church of São Sebastião, or Misericórdia, belongs to a vernacular style of religious architecture, with a longitudinal plan, with simple façades of single cloth, without any decorative motifs, denouncing the crisis in which the Portuguese court lived at that time. The interior is richly decorated by florals, scrolls and putti in trompe l'oeil, decorating all the interior facades, as was use in the seventeenth century, painted tempera. The main chapel is simple, with a vaulted ceiling of crib, with a retable of rustic, archaic style, dating from the mid-seventeenth century, and the entrance to the sacristy of later construction.