During most of World War II, Denmark was first a protectorate, then an occupied territory under Germany. On 9 April 1940, Germany invaded Denmark in Operation Weserübung and established a de facto protectorate over the country. On 29 August 1943 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 the German demands to institute the death penalty for sabotage.
Just over 3,000 Danes died as a direct result of the occupation. (A further 4,000 Danish volunteers died fighting in the German army on the Eastern Front while 1,072 merchant sailors died in Allied service). Overall this represents a very low mortality rate when compared to other occupied countries and most belligerent countries. (See: World War II casualties).
An effective resistance movement developed by the end of the war, and most Danish Jews were rescued in 1943 when German authorities ordered their internment as part of the Holocaust.
In 2003, in a speech for the 60th anniversary of the end of the 1940–43 collaborationist government, Prime Minister Anders Fogh Rasmussen said that Denmark's cooperation with Nazis was "morally unjustifiable", which was the first public condemnation of the World War II era Danish leadership by a Danish leader.