The military history of Luxembourg is central to the formation of Luxembourg as a nation from its formation around Luxembourg Castle in 963. A place of strategic military significance, Luxembourg had been fortified since the 10th century by over 50,000 m2 (538,195.52 sq ft) of walls and towers. Ruled by the House of Luxembourg in the early medieval period, Luxembourg was subsequently invaded by the Bourbons, Habsburgs, Hohenzollerns, and the French, among others. After the defeat of Napoleon in 1815, Luxembourg was disputed between Prussia and the Netherlands.
The Belgian Revolution of 1830–1839 reduced Luxembourg's territory by more than half, as the predominantly francophone western part of the country was transferred to Belgium. Luxembourg's independence was reaffirmed by the 1839 First Treaty of London and again by the 1867 Second Treaty of London, after the Luxembourg Crisis nearly led to war between Prussia and France. The King of the Netherlands remained Head of State as Grand Duke of Luxembourg, maintaining personal union between the two countries until 1890. At the death of William III, the Dutch throne passed to his daughter Wilhelmina, while Luxembourg (at that time restricted to male heirs by the Nassau Family Pact) passed to Adolph of Nassau-Weilburg.