 U-40 left Wilhelmshaven on 19 August 1939, before World War II began, for her first patrol. For nearly four weeks she operated off the coast of Gibraltar, before returning home on 18 September that same year. U-40 would once again leave Wilhelmshaven, this time under the command of Kapitänleutnant Wolfgang Barten, on 10 October 1939. During this patrol, she was to conduct joint operations off the coasts of Portugal and Spain.
