The Church de San Andrés is located on the site of a former church from the times of Moorish occupation. The former church had been frequented as a parish church by the patron saint of Madrid, San Isidro Labrador, and his wife Santa María de la Cabeza, who lived nearby.
The adjacent chapel of San Isidro was built at the site of the saint's house. Its construction began in 1657, after the saint was canonized in 1622. Further reconstructions were performed in 1663 and 1669, and later in 1783 and 1789. The initial construction in Baroque style was fashioned by José de Villarreal, and later Pedro de la Torre and Juan de Lobera. Much of the internal decoration, including paintings, were destroyed during the Spanish Civil War.
References:The first written record of church in Danmark locality date back to the year 1291. Close to the church are several stones with a Christian text and cross inscribed. The oldest parts of the present red-brick church are from the 1300s. In the late 1400s the church was enlarged to the appearance it has today. The church has been modified both internally and externally several times, among other things after the fires in 1699 and 1889. There are lot of well-preserved mural paintings in the walls.