During the War of the Two Peters, the city was occupied by Castilian troops for nine years, and the cathedral was damaged during this time.