The German military then turned its attention westward, and in April 1940 invaded Denmark. "Schleswig-Holstein" was assigned to the naval component of the invasion force. During the invasion, the ship was briefly grounded in the Great Belt, west of Agersø. Following the operation, she was transferred back to training duties, as the flagship of the Chief of Training Units. At the end of 1943, the reactivation of "Schleswig-Holstein" was once again contemplated. In her favor was the fact that she retained some coal-fired boilers, given the ever-worsening oil-supply situation. Thus, on 1 February 1944 she was once again recommissioned, at first taking up her old role as a cadet training ship, then later in the year docking at Gotenhafen (Gdynia) for a refit. She was to be converted into a convoy escort ship with a greatly enhanced anti-aircraft armament, but after being hit three times by Royal Air Force bombers on 18 December 1944, she eventually foundered in shallow water. As the ship was permanently disabled, her crew was sent ashore to assist in the defense of Marienburg.