From the 820s the town declined because of repeated Viking invasions