 In 1278, Ermengol X, Álvaro's eldest son, succeeded in recovering most of his lost patrimony and came to an agreement with Peter whereby he recognised the latter as his suzerain.In 1280, Peter defeated the stewing rebellion led by Roger-Bernard III after besieging the rebels in Balaguer for a month.Most of the rebel leaders were imprisoned in Lleida until 1281, while Roger-Bernard was imprisoned until 1284.