Somosierra is a municipality in the Community of Madrid, Spain, located at 83 km north of Madrid, in the mountain pass with the same name, at an elevation of 1433 metres above sea level, being the northernmost town of Community of Madrid. The Battle of Somosierra was fought here in 1808 during the Napoleonic Wars, and the Battle of Guadarrama was fought nearby in 1936 during the Spanish Civil War.