During the 11th century, Cerdanya became increasingly feudalised and drawn into the orb of Toulouse and Foix. The counts of Toulouse desired to control the pass of Pimorent () in Cerdanya, and those of Foix desired some control of the frontier with Moorish Lérida. The counts of Cerdanya, for their part, were interested in furthering their control of the church in the Midi and Catalonia; they had already controlled the important monasteries of Sant Miquel de Cuixà and Ripoll since the early 10th century. In 1016, they purchased the right to the archbishopric of Narbonne for 100,000 "solidi" for their relative Guifred and, not long after, that to the bishopric of Urgell as well. The famous Abbot Oliva was a member of the ruling dynasty of Cerdanya. When Count Raymond Wilfred plundered the Sant Miquel de Cuixà and entered into a feud with the Bishop of Elne, it gave the nobles opportunity to grant their services to whoever offered them the most advantage at the moment.