Rodrigo Díaz de Vivar (about 1043 – 1099 AD), known as El Cid, was a Castilian nobleman. He was a military leader in medieval Spain. After his death, he became the hero in a mediaeval Spanish poem, El Cantar de mio Cid.

Exiled from the court, El Cid went on to command a Moorish force. After the Christian defeat, El Cid was recalled to service. He took command of a combined Christian and Moorish army. He used this army to create his own fiefdom in Valencia. He was a brave general that lead his country to victory. El Cid was born in Vivar, also known as Castillona de Bivar. The Muslims gave him the nickname "El Cid" from the Spanish Arabic word al-sid, meaning "lord."

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 of Castile when Sancho became king in 1065.

Sancho wanted to reunite all the three parts of his dead father's kingdom. Rodrigo 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. Sancho was murdered in 1072.