The Battle of Clavijo is a mythical battle. "To a serious historian, the existence of the Battle of Clavijo is not even a topic of discussion". However, it was believed for centuries to be historical, and it became a popular theme of Spanish traditions regarding the Christian expulsion of the Muslims. The stories about the battle are first found centuries after it allegedly occurred; according to them, it was fought near Clavijo between Christians, led by Ramiro I of Asturias, and Muslims, led by the Emir of Córdoba.
In the legend, James, son of Zebedee, an Apostle of Jesus, and future Saint James/Santiago, who died 800 years earlier, suddenly appeared and led an outnumbered Christian army to gain its victory. He became the patron saint of Spain and is known to Spaniards as Santiago Matamoros ("the Moor-killer"). Aspects of the historical Battle of Monte Laturce (859) were incorporated into this legend, as Claudio Sánchez-Albornoz demonstrated in 1948. The date originally assigned to the battle, 834, was changed in modern times to 844 to suit the inherent contradictions of the account. The day is sometimes given as 23 May.
The legend as it survives was first written down about 300 years after the supposed event on a spurious charter. Another item, a forged grant to the Church of Santiago de Compostela by which Ramiro reportedly surrendered a part of the annual tribute owed him by all the Christians of Spain, also dates from the mid-twelfth century. The history of the cult of Saint James is rich in such frauds. Historian Jean Mitchell-Lanham says, "While this event is based on legend, the supposed battle has provided one of the strongest ideological icons in the Spanish national identity."
Saint James' appearance at Clavijo has been a major theme in art. Among those artists who portrayed him there are Aniello Falcone, Paolo da San Leocadio, Evaristo Muñoz, Mateo Pérez, Martin Schongauer, Corrado Giaquinto, and Antonio González Ruiz.