Deck gun A deck gun is a type of artillery cannon mounted on the deck of a ship or submarine . The deck gun was used as a defensive weapon against smaller boats or ships and in certain cases where torpedo use was limited . Typically a crew of three ; gunner , loader and layer , operated the gun , while others were tasked with supplying ammunition . A small locker box held a few ' ready - use ' rounds . With a well - drilled , experienced crew , the rate of fire of a deck gun could be 15 to 18 aimed shots per minute . History . The deck gun was first used during World War I by the Germans and proved its worth when the U - boat needed to conserve torpedoes , or attack enemy vessels straggling behind a convoy . Submarine captains often considered the deck gun as their main weapon , using torpedoes only when necessary . Lothar von Arnauld de la Perière used a deck gun on 171 of his 194 sinkings . In early World War II , German and American submarine commanders favoured the deck gun because of the unreliability of torpedoes . The deck gun became less effective as convoys became larger and better equipped , and merchant ships were armed . Surfacing also became dangerous in the vicinity of a convoy because of improvements in radar and direction finding . ( See Defensively Equipped Merchant Ships [ DEMS ] and United States Navy Armed Guard ) . German U - boat deck guns were eventually removed on the order of the supreme commander of the U - boat Arm ( BdU ) during World War II . Some deck guns stayed on ships , but today they are no longer in use . Two notable deck guns from German U - boats used in World War II were the SK C / 35 ( not to be confused with famous 8 . 8 cm Flak ) and the SK C / 32 . The 88 mm had ammunition that weighed about and was of the projectile and cartridge type . It had the same controls on both sides of the gun so that the two crewman that were in charge of firing it could control it from either side . The 105 mm evolved from the 88 mm in the sense that it was more accurate and had more power due to the ammunition it fired . Japanese submarine cruisers used 14 cm / 40 11th Year Type naval gun s to shell California , British Columbia and Oregon during World War II . The 6 " / 53 caliber gun Mark 18 ( 150 cm ) on the , and , was the largest deck gun to be fitted on any United States submarine . British M - class submarine s mounted a single Armstrong Whitworth 12 inch / 40 naval gun intended to be fired while the submarine was at periscope depth with the muzzle of the gun above water . This World War I design was found unworkable in trials because the submarine was required to surface to reload the gun , and problems arose when variable amounts of water entered the barrel prior to firing . The French submarine " Surcouf " was launched in 1929 with two 203mm / 50 Modèle 1924 gun s in a turret forward of the conning tower . The London Naval Treaty of 1930 restricted submarine guns to a maximum of . In the Royal Navy , the was the last British submarine to be fitted with a deck gun ( a 4 - inch QF version ) . HMS " Andrew " was scrapped in 1977 . The last submarines in service in any navy to mount a deck gun were two of the four Abtao class submarine s of the Peruvian Navy in 1999 .