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. 