Passage: The castle was built largely during the 11th and 12th centuries, when its position on the frontier between Christian and Muslim lands gave it strategic importance. The first of the two major building programmes began circa 1020, when Sancho el Mayor (r. 1063–94) reconquered the surrounding lands from the Muslims.

Question: When did the programmes begin?
1020