The building was designed by the architect Pedro Sánchez in 1620. Construction work began two years later, directed by the architect until his death in 1633. It was later continued by Francisco Bautista and Melchor de Bueras, who finished the work in 1664. The church replaced the parish church of St. Peter and St. Paul, which had been demolished to create the earlier Imperial College, following the instructions left in her will by Empress Mary of Austria, daughter of Charles I and sister to King Phillip II of Spain. The Empress bequeathed her fortune to the Jesuit Order in order that a new building could be built on the site of the demolished parish church. The church was consecrated on 23 September 1651, thirteen years before its completion. It was initially attached to the aforementioned Jesuits order and dedicated to St. Francis Xavier, one of the most distinguished Jesuits and Saint patron of the Catholic Missions. However, in 1767, with the expulsion of the Jesuits, the building became a collegiate church. Two years later, in 1769, the church was rededicated to Saint Isidore to mark the translation of the saint's body from the Church of St. Andrew. St. Isidro is the Saint protector of the city of Madrid and his remains had been guarded since the sixteenth century in the Bishop's Chapel at St. Andrew's church. The relics of his wife Saint Mary of the Head were also transferred. Its interior was then renovated by the famous architect Ventura Rodríguez, who designed a new richly decorated chancel and high altar. In 1885, with the establishment of the Roman Catholic Archdiocese of Madrid, the church became the pro-cathedral of the city. The church held that rank until the current Almudena Cathedral was completed in 1993, when it returned to its collegiate status. Until Almudena Cathedral was completed, the building housed images of the Virgin, of the St. Isidro and of the Christ of the Good Death, a masterful piece of work by Juan de Mesa. These works were then moved to Almudena Cathedral. In 1936, at the very beginning of the Spanish Civil War, the building caught fire, which destroyed many works of art, including the altarpiece of Ventura Rodríguez, as well as paintings by Luca Giordano Ricci. The fire also caused the collapse of the dome. After the war the church was painstakingly restored over two decades, trying to recover the original features, culminating in the 1960s with the rise of a new section on the towers of the facade by the architect Javier Barroso. A remarkably faithful replica of the high altar of Ventura Rodríguez was also made. As a curious note the restoration of one of the chapels was paid for by the British Embassy in Madrid and the British coat of arms can be clearly seen over Our Lady altar.