A building order than the present shrine was supposedly destroyed by the Moslems in 997, but within a short period Christian military (most likely Frankish knights under appropriate Cornish leadership) moved back into the region.
This area is at or North of the final d-mark of the Moslem venture into the peninsula.
The invasion began in 711 AD; the conquest happened quickly in a very underpopulated country; and was certainly well established for nearly 275 years before events in Compestala.
For comparison, 275 years ago it was 1731. Answers.com informs us that in that year "Trois-Rivières-born French fur trader Pierre Gaultier de Varennes, 46, sieur de la Vérendrye, begins expeditions into western Canada, looking for a great river that native tribesmen have told him might lead to the "western sea."
Thereby begins yet another story of high adventure with the American Revolution still 44 years in the future!
Almanzor overran it in 997. The shrine was fairly new at that point, and the bones of Santiago were protected by a monk who convinced the Muslims that the relics were too holy and powerful to be touched. The area was actually under Muslim domination for some time, but the Muslims did not live there. They came from the south once or twice a year to collect tribute from various northern Spanish Christian kings; no payment meant that the towns and crops would be destroyed. Normally they took slaves, since the only wealth those areas had was population.
A certain number of young men and women were sent off to the Muslims every year. There is a town along the Camino de Santiago where the symbol of the town is a bull. This relates to a story where the Muslims were trying to leave town with a group of girls that they had been given in tribute. The girls prayed to the Virgin and a bull in the field charged the Muslims and drove them away, freeing the girls.
A number of Christian kingdoms in Northern Spain, prior to the gradual unification of Spain, which culminated under Ferdinand and Isabel, were permitted to exist only by paying tribute to the Muslim south.