El Cid became a literary figure early on as the main character in the legend that bears his name. The Historia Roderici, which was probably written at the beginning of the 12th century, tells of the deeds of the Cid in a fairly sober Latin language. There is only one manuscript of the famous Old Spanish epic El Cantar de Mio Cid[8], which has recently[9] been dated quite precisely to 1235 and is kept in the National Library in Madrid. According to the current prevailing opinion, confirmed by Spanish researchers in 2006[10], this is a copy of the original of the epic written down by a certain Pere Abat in 1207. Some researchers have assumed that the origins of this poem, whether transmitted orally or in writing, date back to the first half of the 12th century; however, this opinion is highly controversial and is rarely held today. In the work, the Cid is glorified as the ideal figure of Spanish chivalry and (unhistorically) portrayed as a champion or pioneer of the idea of the Crusades. For this reason, the fact that the Cid was in the service of Moorish princes for a long time is generously overlooked, because he is supposed to be the defender of Christianity and the victor over the Moors. The heroic epic (Chanson de geste) is one of the great works of Spanish medieval literature and accounts for more than half of the surviving Spanish heroic epics.
From the later Middle Ages onwards, the literary material of the Cantar became the subject of a large number of rewritten chivalric novels, chroniclers' reports and retellings. Over time, there were more and more variations and fictions of the story. Even a kind of early "copyright dispute" developed from this, when the tragicomedy Le Cid by Pierre Corneille, performed in 1636 and very successful in France, sparked a literary feud (Querelle du Cid). However, the early heroic song itself was practically forgotten; it was not published until 1779 and then rediscovered by the Romantic movement, which glorified the Middle Ages. In German-speaking countries, this was also due to the verse epic “The Cid” written by Johann Gottfried Herder, which was one of his last works and was particularly popular in the 19th century.