Ordoño II built the temple on the site of his royal palace as a show of gratitude for defeating the Moors at the battle of San Esteban de Gormaz. His remains were buried there. Alfonso V was crowned in this building in 999. The Infanta Doña Urraca, daughter of Fernando I, favoured the construction of a new building in brick and masonry, with three naves terminating in apses. The stained glass in the Cathedral is from the 13th through to the 20th century, and covers an area of 1,765 square metres. Under its floor there are Roman hippocausts which made it difficult to set the foundations of the pillars and caused water filtration.