Königsberg served as a training ship for naval cadets throughout the 1930s, and joined the non-intervention patrols during the Spanish Civil War in the late 1930s. After the outbreak of World War II in September 1939, she laid defensive minefields in the North Sea and then participated in Operation Weserübung, the invasion of Norway in April 1940. While attacking Bergen, she was badly damaged by Norwegian coastal artillery, and sunk by British bombers the following day in the harbor.