Rodrigo and other leaders of Christian Spain were not the only ones who considered Valencia important: when the Almoravids learned of the city's conquest by Rodrigo, they quickly sent a force against him. Leading a much smaller army, Rodrigo devastated the Almoravids in battle on October 14, 1094—the first time the Moorish invaders had suffered a defeat since their arrival in Spain eight years before.
Ironically, the man who had spent so much of his life in the saddle, sword in hand, died peacefully in his bed on July 10, 1099. Following his death, his wife Jimena struggled to maintain control over Valencia, a conflict in which Alfonso came to her aid. After three years, however, Alfonso could no longer defend the city, and he urged Jimena to give it up and come to Castile. Valencia fell to the Almoravids in May 1102, and it would not return to Christian hands until 1238.
By that time, Rodrigo's life story was being turned into a myth, which became the Poema de mio Cid, a work of anonymous authorship sometimes translated as The Lay of the Cid. The nickname El Cid, meaning "The Master" in Arabic, actually came from Rodrigo's enemies, who were some of his greatest admirers. Thus the Arab historian Ibn Bassam wrote that the legendary foe of his people "was one of the miracles of God." To Spaniards, El Cid became immortal as a romantic hero, a defiant individual who triumphed over powers much greater than himself.