Rodrigo Díaz de Vivar, known in Spanish as El Cid Campeador, was a real Spanish warrior who later became a literary hero.
The real Cid was a mercenary; he fought in both Muslim and Christian armies. Unlike many literary heroes, there is a lot of documentation about the Cid.
He began his military life serving Christian kings such as Sancho II. Still, when he fell into disgrace and was exiled by Alfonso VI, he offered his services to the taifa of Zaragoza.
Alfonso's service returned, but he banished him again and ended his days in Valencia, where he died a peaceful death.
El Cid's legend became the most significant epic of Spanish medieval literature. Immortalizing him as a crusader and hero of the Spanish Reconquista.
One of his great myths is that he died before a battle, but his allies decided to mount his body on a horse to instill courage in his troops, who, upon seeing him, managed to win the battle.