During the Peninsular War, Sepúlveda witnessed the only battle in which Napoleon's Imperial Guard fought. This action is settled with a failure for the French that fail to destroy the Spanish forces, first withdraw to Sepúlveda and then, undisturbed, for Segovia. The action was a delay to the Napoleon's advance towards Madrid before the Battle of Somosierra. Sepúlveda was besieged by French troops on its territory and Juan Martín Díez (which was based in the caves of Duratón River Canyon) acted.