The monastery was founded around the year 1187 by Alfonso VIII of Castile. King Edward I of England and Eleanor of Castile were married here in 1254.