At the outset of World War II in September 1939, Denmark declared itself neutral. For most of the war, the country was a protectorate and then an occupied territory of Germany. The decision to occupy Denmark was taken in Berlin on 17 December 1939. On 9 April 1940, Germany occupied Denmark in Operation Weserübung. The Danish government and king functioned as relatively normal in a "de facto" protectorate over the country until 29 August 1943, when Germany placed Denmark under direct military occupation, which lasted until the Allied victory on 5 May 1945. Contrary to the situation in other countries under German occupation, most Danish institutions continued to function relatively normally until 1945. Both the Danish government and king remained in the country in an uneasy relationship between a democratic and a totalitarian system until the Danish government stepped down in a protest against German demands to institute the death penalty for sabotage.