The road was originally a track opened up by Napoleon to provide a direct route to Madrid. In 1808 this led to the Battle of Somosierra between French-Polish and Spanish forces.