|Builder:||Vickers Armstrong, Barrow-in-Furness|
|Laid down:||24 February 1910|
|Launched:||27 April 1911|
|Commissioned:||29 November 1911|
|Fate:||Sold 17 December 1921 to H Pounds, Portsmouth|
|Class and type:||D class submarine|
|Displacement:||Surfaced= 483 tons / Submerged= 595 tons|
|Length:||163.0 ft (49.7 m) (oa)|
|Beam:||13.6 ft (4.1 m) (oa)|
|Propulsion:||550hp electric 1750hp diesel twin screws|
|Speed:||Surfaced=14.0 kts / Dived= 10.0 (design) 9.0 (service)|
|Range:||Surface= 2500nm at 10 kts / Submerged=45nm at 5knots|
|Armament:||3x18 in (46 cm) torpedo tubes (2 forward, one aft, 6 torpedoes) / 1x12 pdr (76 mm) QF gun|
HMS D4 was a British D class submarine built by Vickers, Barrow. D4 was laid down on 24 February 1910, launched 27 April 1911 and was commissioned on 29 November 1911. She was the first submarine to be fitted with a gun for offensive use.
During D4's career, she sank the grounded the German netlayer Bielefeld in the Heligoland Bight, on 15 June 1915.
Later in her career, D4 torpedoed UB-72 on 12 May 1918. At 04:30 that day, whilst on patrol approximately midway between Guernsey and Portland Bill, D4 observed UB72 on the surface travelling in a southerly direction some two miles distant. Five minutes later Lt Claud Barry in command of D4 saw UB72, obviously unaware of the British boat's presence, alter course so that the U-boat appeared to be approaching D4. In order that his presence should not be detected Lt Barry lowered his periscope for a few minutes but at 0443 D4's periscope was raised to reveal UB72 steering an easterly course. A few minutes later UB72 was on the British boat's port side and Barry waited until the U-boat came on to his sights. At 0450 Lt Barry fired a torpedo 600 yards from target and after lowering periscope for a few moments he released a 2nd one. Ten seconds later the crew of D4 heard an explosion and felt a violent concussion. Barry brought his boat to the surface and headed towards three men swimming in a patch of oil. He succeeded in picking up these men, who were the only survivors of UB72's crew of three officers and thirty-one men. 
D4 was decommissioned in 1919 and was then sold on 17 December 1921 to H Pounds, Portsmouth.
- Fitzsimons, Bernard. Illustrated Encyclopedia of 20th Century Weapons and Warfare (London: Phoebus, 1978), Volume 7, p.674, "D.1".
- Fitzsimons, p.674.
- *Innes McCartney (2002). Lost Patrols: Submarine Wrecks of the English Channel.
- Colin Hague, nephew of Petty Officer James Hollier Hague, coxswain to D4 in 1918 when she sank UB-72.
- Submarines, war beneath the waves, from 1776 to the present day, By Robert Hutchinson
- The Royal Navy Submarine Service, A Centennial History, by Antony Preston
- Colledge, J. J.; Warlow, Ben (2006) . Ships of the Royal Navy: The Complete Record of all Fighting Ships of the Royal Navy (Rev. ed.). London: Chatham Publishing. ISBN 978-1-86176-281-8. OCLC 67375475.