Ermengol or Armengol I (974–1010), called el de Córdoba, was the count of Urgell from 992 to his death. He was the second son of Borrell II of Barcelona and his first wife, Letgarda. He was the second of the counts of Urgell and famous mainly for his participation in the Reconquista.
A man of culture, Ermengol was open to influences from wider Europe and made two voyages to Rome, in 998 and 1001. He was a stimulus to his nobles in making pilgrimages to Santiago de Compostela and Le Puy. He also reformed the judiciary of his county to make justice more available to all.[1] He also began to reassert his authority over the outlying castles of his realm, whose lords were acting independently of his power.[1]
Ermengol also maintained an intense war against the Caliphate of Córdoba. In 1003, Urgell was invaded by Abd al-Malik al-Muzaffar. Aided by the brothers Bernard I of Besalú and Wifred II of Cerdagne, and his own brother, Ramon Borrell of Barcelona, Ermengol defeated them at the Battle of Torà, followed by a narrower victory at the Battle of Albesa.[2] He was captured by Abd al-Malik, the Córdoban hajib, during reprisals in the summer, but was freed by March 1004. In 1008, he led several successful expeditions against the Moors.[3] In 1010, he participated in the expedition of his brother Ramon Borrell of Barcelona against Córdoba itself. He died nearby at Castell de Bacar. His testament, dated around 1010, includes one of the first-attested mentions of the game of chess in Western Europe.