During the Second World War, the German Navy built over a thousand U-boats or submarines for service in the Battle of the Atlantic and elsewhere. Although the majority of these had active service careers, and 784 of them were lost at sea, there were still several hundred boats which were never completed or completed too late to see any war service. These boats were sometime solely commissioned as training craft, or were too badly damaged by bombing to be worth completion. Most however were finished in the last six months of the war and never had time or enough fuel to complete their training programs. These boats remained in German harbours up until April/May 1945, when most were taken out to sea by skeleton crews and scuttled to prevent the allies capturing them. The boats that were captured were taken by the Allies to Loch Ryan in Scotland and Lisahally in Northern Ireland. Some were presented to allied navies for commissioning or experiments, but the majority of captured U-boats were towed out to sea in the autumn of 1945 and sunk by gunfire in Operation Deadlight.