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 the territory of the Crown of Castile 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 sovereign, he lost his ranking in the new court which treated him suspiciously and kept him at arm's length. Finally, in 1081, he was ordered into exile.
El Cid found work fighting for the Muslim rulers of Zaragoza, whom he defended from its traditional enemy, Aragon. 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 AfricanAlmoravids inflicted a severe defeat to Castile, compelling Alfonso to overcome the resentments he harboured against El Cid. The terms for the return to 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, Yahya al-Qadir [es], 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 video games.
First paragraph of the Carmen Campidoctoris, the earliest literary treatment of El Cid's life, written to celebrate El Cid's defeat of some counts and champions
The name El Cid (Spanish: [el ˈθið]) is a modern Spanish denomination composed of the article el meaning "the" and Cid, which derives from the Old Castilian loan word Çid borrowed from the dialectal Arabic word سيد sîdi or sayyid, which means "Lord" or "Master". The Mozarabs or the Arabs that served in his ranks may have addressed him in this way, which the Christians may have transliterated and adopted. Historians, however, have not yet found contemporary records referring to Rodrigo as Cid. Arab sources use instead Rudriq, Ludriq al-Kanbiyatur or al-Qanbiyatur (Rodrigo el Campeador). The cognomen Campeador derives from Latin campi doctor, which means "battlefield master". He probably gained it during the campaigns of King Sancho II of Castile against his brothers King Alfonso VI of León and King García II of Galicia. While his contemporaries left no historical sources that would have addressed him as Cid, they left plenty of Christian and Arab records, some even signed documents with his autograph, addressing him as Campeador, which prove that he used the Christian cognomen himself. The whole combination Cid Campeador is first documented ca. 1195 in the Navarro-AragoneseLinage de Rodric Díaz included in the Liber Regum under the formula mio Cid el Campeador.