A previous church, also entitled to El Salvador ("Holy Savior") existed at the time of King Alfonso VII of Castile, but it was apparently in ruins, so that the king donated the church of St. Thomas in the city to act as cathedral.
The church was built under bishop Esteban, under the patronage of Alfonso VII and his sister, Sancha Raimúndez.