Oliba, the count of Besalú and Cerdanya, entered Ripoll as a monk in 1002. He became the abbot of Ripoll and Cuixà and the bishop of Vic, and instigated a movement of renewal. In Rome, he negotiated the independence of the Catalan Church from Narbonne. He was an adviser to the Countess Ermessenda and an intermediary in various conflicts. He founded schools, scriptoria and churches. He played a leading part in resistance against feudal violence. In 1027, he presided over the synod at Toluges, which set up the Peace and Truce of God, which prohibited war on certain days of the week and granted immunity to the property and men of the church, as well as the area surrounding churches.