UD-5 was an . The boat was laid down as the Dutch submarine HNLMS K XXVII and renamed HNLMS O 27 but was captured during the German invasion of the Netherlands in World War II and commissioned in the Kriegsmarine. The ship survived the war and was returned to the Netherlands where she served under her old name until 1959.
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.[1]
The Germans decided to complete her. The launch took place on 26 September 1941. She served in the Kriegsmarine as UD-5 and was commissioned on 30 January 1942.[1] [2]
From November 1941 to August 1942, UD-5 served as training boat in Kiel when attached to the 5th Flotilla. From August 1942 until January 1943, the boat was stationed at Lorient in occupied France and attached to the 10th Flotilla.[1]
When patrolling west of Freetown, UD-5 spotted and sunk the British freighter on 29 October 1942.[1]
In January 1943, the boat was transferred to Bergen in occupied Norway and attached to the U-boot Abwehr Schule to be used as school boat until May 1945. UD-5 surrendered on 9 May 1945. UD-5 was planned to be scuttled as part of Operation Deadlight but was recognized as a former Dutch boat and was returned to the Royal Netherlands Navy. On 13 July 1945, she was commissioned in the Dutch Navy as O 27.[1]
She served in the Dutch navy until she was stricken on 14 November 1959. She was stationed in Den Helder where she served as torpedo trial boat, piggy boat and training vessel. In 1961, she was broken up.[1]