The submarine was ordered on 8 July 1938 and laid down on 3 August 1939 as K XXVII at the Rotterdamsche Droogdok Maatschappij, Rotterdam. During construction she was renamed O 27. Following the German invasion of 10 May 1940, the not yet launched O 27 was captured at the yard by the invading forces.[2]