He was hostile to Count Raymond Berengar IV of Barcelona, but Raymond's son King Alfonso II of Aragon divided the lands taken from Murcia with him by treaty of Sangüesa in 1168. In 1190, the two neighbours again signed a pact in Borja of mutual protection against Castilian expansion.