El Cid was portrayed as being loyal to Alfonso VI, king of Castile and Leon, but he first became prominent fighting against Alfonso and was never a fully trustworthy champion for Alfonso. When Alfonso exiled him, he served the Muslim rulers of Zaragoza for almost a decade before conquering Valencia.