The Almoravids, a Moroccan Islamic sect, had first invaded the Iberian peninsula in 1086, where they scored a victory over Castile at the Battle of Sagrajas.
[3] The brief but most detailed account of the battle is found in the Deeds of the Counts of Barcelona, the original version of which was written in the mid-12th century by an anonymous monk of Santa Maria de Ripoll, with later redactions and a Catalan translation appearing in the 14th century: Ermengol of Mollerussa [was] so called because it was in a place called Mollerussa with the three hundred knights, it is said, and a number of other Christians that he was killed by the Almoravids, under Count Ramon Berenguer the third, in the year of Christ 1102.
[9] The Chronicon Rotense II, written at the cathedral of Roda de Isábena, is in fact the earliest source, but provides no more than that in 1102 Ermengol died at Mollerussa.
[11] Owing to the diverse and inconsistent spellings for "Mollerussa" in the medieval sources, scholars in the past have proposed that the battle at which Ermengol V was killed took place in Mayorga in the Kingdom of León or on the Muslim-controlled island of Mallorca, both far from Urgell.
[13] The necrology of the cathedral of Solsona dates the battle to 14 September: "The eighteenth kalends of October: this day did the pagans kill the most noble Count Ermengol, who many times served God and the Blessed Mary and her clergy.