The First Schleswig War (German: Schleswig-Holsteinischer Krieg) or Three Years' War (Danish: Treårskrigen) was the first round of military conflict in southern Denmark and northern Germany rooted in the Schleswig-Holstein Question, contesting the issue of who should control the Duchies of Schleswig and Holstein. The war, which lasted from 1848 to 1851, also involved troops from Prussia and Sweden. Ultimately, the war resulted in a Danish victory. A second conflict, the Second Schleswig War, erupted in 1864.
At the beginning of 1848, Denmark contained the Duchy of Schleswig and controlled the duchies of Holstein and Saxe-Lauenburg in the German Confederation. These were where the majority of the ethnic Germans in Denmark lived. Germans made up a third of the country's population, and the three duchies were behind a half of Denmark's economic power. The Napoleonic Wars, which ended in 1815, had increased Danish and German nationalism. Pan-German ideology had become highly influential in the decades prior to the war outbreak and writers such as Jacob Grimm argued that the entire Peninsula of Jutland had been populated by Germans before the arrival of the Danes and that therefore it could justifiably be reclaimed by Germany. These claims were countered in pamphlets by Jens Jacob Asmussen Worsaae, an archaeologist who had excavated parts of Danevirke, who argued that there was no way of knowing the language of the earliest inhabitants of Danish territory, that Germans had more solid historical claims to large parts of France and England, and that Slavs by the same reasoning could annex parts of Eastern Germany.