 In 1099, the Almoravids conquered a large number of the castles that defended Toledo and the surrounding areas and, in the following year, they tried unsuccessfully to seize the city.Henry of Burgundy, Alfonso's son-in-law, was in charge of defending Toledo since the king, at that time, was in Valencia inspecting its defenses.El Cid had died the previous year and his widow, Jimena, was governing the city.