Rodrigo Díaz de Vivar, known as El Cid, was born in 1043 in Castile, Spain. He was orphaned at age 7 and was educated at the court of King Fernando I of León and Castile. El Cid became a knight and fought alongside King Sancho II against Muslim kingdoms. After Sancho's death, El Cid served King Alfonso VI but was exiled twice for disobeying the king. During his exiles, El Cid worked as a mercenary for both Christian and Muslim rulers. He eventually conquered the Kingdom of Valencia in 1093 and ruled as its king until his death in 1099.