Rodrigo Díaz de Vivar (c. 1043 - 1099) was a Castilian nobleman and military leader in medieval Spain. The Moors called him El Cid, which meant the Lord (probably from the original Arabic al-Sayyid, ???????), and the Christians, El Campeador, which stood for Outstanding Warrior or The one who stands out in the battlefield. He was born in Vivar, a town near the city of Burgos. After his death, he became Castile's celebrated national hero and the protagonist of the most significant medieval Spanish epic poem, El Cantar de Mio Cid.
Born a member of the minor nobility, El Cid was brought up at the court of King Ferdinand the Great and served Ferdinand's son, Sancho II of León and Castile. He rose to become the commander and royal standard-bearer (armiger regis) of Castile upon Sancho's ascension in 1065. Rodrigo went on to lead the Castilian military campaigns against Sancho's brothers, Alfonso VI of León and García II of Galicia, as well as in the Muslim kingdoms in Al-Andalus. He became renowned for his military prowess in these campaigns, which helped expand Castilian territory at the expense of the Muslims and Sancho's brothers' kingdoms. When conspirators murdered Sancho in 1072, Rodrigo found himself in a difficult situation. Since Sancho was childless, the throne passed to his brother Alfonso, the same whom El Cid had helped remove from power. Although Rodrigo continued to serve the Castilian sovereign, he lost his ranking in the new court which treated him at arm's length and suspiciously. Finally, in 1081, he was ordered into exile.
El Cid found work fighting for the Muslim rulers of Zaragoza, whom he defended from their traditional enemies, Aragon and Barcelona. While in exile, he regained his reputation as a strategist and formidable military leader. He repeatedly turned out victorious in battle against the Muslim rulers of Lérida and their Christian allies, as well as against a large Christian army under King Sancho Ramírez of Aragon. In 1086, an expeditionary army of North African Almoravids inflicted a severe defeat to Castile, compelling Alfonso to overcome the resentments he harbored against El Cid. The terms for the return to the Christian service must have been attractive enough since Rodrigo soon found himself fighting for his former Lord. Over the next several years, however, El Cid set his sights on the kingdom-city of Valencia, operating more or less independently of Alfonso while politically supporting the Banu Hud and other Muslim dynasties opposed to the Almoravids. He gradually increased his control over Valencia; the Islamic ruler, al-Qadir, became his tributary in 1092. When the Almoravids instigated an uprising that resulted in the death of al-Qadir, El Cid responded by laying siege to the city. Valencia finally fell in 1094, and El Cid established an independent principality on the Mediterranean coast of Spain. He ruled over a pluralistic society with the popular support of Christians and Muslims alike.
El Cid's final years were spent fighting the Almoravid Berbers. He inflicted upon them their first major defeat in 1094, on the plains of Caurte, outside Valencia, and continued resisting them until his death. Although Rodrigo remained undefeated in Valencia, his only son, and heir, Diego Rodríguez died fighting against the Almoravids in the service of Alfonso in 1097. After El Cid's death in 1099, his wife, Jimena Díaz, succeeded him as ruler of Valencia, but she was eventually forced to surrender the principality to the Almoravids in 1102.
To this day, El Cid remains a Spanish popular folk-hero and national icon, with his life and deeds remembered in plays, films, folktales, songs, and even video games.