In 1060 the nation came under the rule of Count Conrad, founder of the house of Luxemburg, which provided the Holy Roman Empire with four emperors in the 14th and early 15th centuries before being superseded in 1437 by the Habsburg dynasty. For the next four centuries, Spain and Austria alternately controlled the nation. At the close of the Napoleonic Wars in 1815, Luxembourg was accomplished as a grand duchy by the Congress of Vienna and placed under the rule of William I, king of the Netherlands. In 1830 the Belgian provinces of the Netherlands revolted, and the grand duchy joined them. By the end of that year, Belgium had become an autonomous kingdom, and Luxembourg remained a part of the new nation until 1839, when its western portion was ceded to Belgium and the remainder was recognized as a sovereign and independent state. The Dutch king retained nominal authority as grand duke.
During World War II (1939-1945) Luxembourg was invaded by Germany on May 10, 1940. The reigning grand duchess, Charlotte, consequently accomplished a government-in-exile in London. In August 1942 the Germans proclaimed the grand duchy a part of the Third Reich.Allied military forces liberated Luxembourg in September 1944, and the nation was restored to civilian control. On June 26, 1945, it became an original member of the United Nations. An agreement establishing the Benelux Customs Union among Belgium,The Netherlands, and Luxembourg, took effect on January 1, 1948. Under the terms of a constitutional amendment adopted later in 1948, Luxembourg abrogated its orthodox neutrality.