Under the patronage of the Dukes of Medinaceli.
Built of sandstone in the upper part of the city, the church came under the patronage of the Dukes of Medinaceli, the governors of El Puerto de Santa María.
Building began in the 13th century, but would not be completed until the 17th. The interior comprises three naves with cross-vaulted ceilings and side chapels. There is an unfinished Baroque portico, known as the Portada del Perdón, designed in the form of an altarpiece, and another, the Puerta del Sol, also Baroque, which is the main entrance. The altarpiece of the main altar was replaced with a Renaissance baldachin and a staircase with balustrade. Inside there are important religious images such as a 13th-century Virgin of Miracles, to whom the church is dedicated, and a figure of Christ by Pedro Roldán. In the chapel of the Tabernacle there is an excellent altarpiece in Mexican silver.