 When Peter died in 1295, Ermengol became a close companion and adviser of his sons Alfonso III, whom he aided in conquering the Kingdom of Majorca in 1287, and James II.Before dying at Camporrells without descendants, he named the second son of James II, Alfonso, as his heir on the condition that he should marry his grandniece, Teresa de Entença, his legal heir.With his death, the House of Cabrera came to an end.