sentences:  Those killed included a very popular imam from Cordoba, Abu-l-Abbas Ahmad ibn Rumayla, and members of Ibn Khaldun's family are also known to have been killed in the battle.The battle was a decisive victory for the Almoravids but their losses meant that it was not possible to follow it up although Yusuf had to return prematurely to Africa due to the death of his heir.Castile suffered almost no loss of territory and was able to retain the city of Toledo, occupied the previous year.