Afonso Henriques's victory over Almoravid forces at Ourique in July 1139 became the founding legend of the Portuguese crown — the battle after which he was styled king.
The battle of Ourique, fought on 25 July 1139, occupies a double place in Portuguese history: a real military victory over Almoravid forces, and the seed of the monarchy's founding legend. The contemporary record is one thin line of annals; what is certain is the consequence — from about this date Afonso Henriques's documents call him king, and his descendants dated the monarchy from the field of Ourique.
Everything vivid about the battle belongs to later centuries. The vision of Christ promising victory, the five Moorish kings slain, the acclamation on the battlefield, the divine origin of the five-shield arms of Portugal — these grew in chronicles and shrine-lore from the fourteenth century onward, achieving their full form in the era when Portuguese independence again needed miraculous credentials. The article's duty is to keep the two Ouriques distinct.
The near-contemporary Portuguese annals record only that Afonso fought and defeated a Muslim force at Ourique in July 1139 — probably a deep raid into Almoravid Alentejo striking a regional army, not the apocalyptic clash of legend. Even the site is debated: the southern Ourique of tradition sits improbably deep in Muslim territory for 1139, and historians have proposed locations closer to the Tagus frontier.
The political use was immediate and real. Victory in the field was the classic Iberian warrant for royal rank — as Aragon and Navarre's kings had shown — and Afonso, already effectively independent since São Mamede, converted Ourique's prestige into the title his charters begin using: Alfonsus Portugallensium rex. The assemblies later tradition placed at Lamego to "elect" him are early modern invention; the charters are the true coronation.
The Ourique legend — Christ appearing to Afonso on the eve of battle, promising that he and his line would be God's chosen kings — first appears fully formed centuries after the battle and served each age that retold it: legitimising the new dynasty of Aviz after 1385, anchoring resistance to Castile, and furnishing the national arms with a sacred etymology (the five escutcheons as the five wounds of Christ, the five defeated kings).
IronCodex treats the legend as what it is: one of medieval and early modern Europe's most successful pieces of dynastic myth-making, comparable to France's Clovis ampulla or Denmark's falling Dannebrog. The historical battle mattered because a frontier count needed a crown; the legendary battle mattered because a kingdom needed a covenant. Both are part of Ourique's history — as long as they are never confused.