Late in the 10th century, Alt Rosselló, Conflent, and inland Vallespir passed to the counts of Cerdanya and Roussillon was reduced to the coastal regions of Roussillon and Vallespir. Throughout the century, Empúries was the centre of comital power and the counts had their seat there. It was only when Viking and Moorish pirates forced him to move from the coast to the more easily defensible inland that Gausfred I made his capital at Castelló d'Empúries. After his death, the counties were separated, with Roussillon going to his younger son, Giselbert I.