By 1939 he was a staff-officer of the Hamburg Kriegsmarine Service Centre (one of the other Kriegsmarinedienststellen, which were responsible for troop movements and the use of merchant shipping for the war office), and later moved to the Boulogne Service Centre. He remained in the area as commander of the Boulogne's coastal defences, from 26th January 1941 onwards. From 16th December 1941 to 28th October 1944, he took over command of the defences of the whole Pas de Calais, though these were non-existent by 15 September 1944, when he was moved to command the Fortress of Dunkirk (Festung Duenkirchen). He was in command of German forces there throughout its long siege in 1944-45 (being promoted to Vice Admiral on September 30 1944), and signed its unconditional surrender at the end of the war. He was held as a POW at Island Farm, the Special Camp 11 at Bridgend, from then until his release on 6th October 1947.