Before 1095, Andorra did not have any type of military protection and the Bishop of Urgell, who knew that the count of Urgell wanted to reclaim the Andorran valleys, asked the lord of Caboet for help and protection. In 1095, the Lord of Caboet and the bishop of Urgell signed under oath a declaration of their co-sovereignty over Andorra. Arnalda, daughter of Arnau of Caboet, married the viscount of Castellbò. Their daughter, Ermessenda, married the count of Foix, Roger-Bernard II. Roger-Bernard II and Ermessenda shared rule over Andorra with the bishop of Urgell.