Police said the incident on HMS Astute, docked in Southampton, southern England, was not terrorism related.
"Two Royal Navy personnel have been involved in a firearms incident at Southampton docks," Britain's defense ministry said in a statement. "Sadly, one has now died as a result of his injuries."
Defense Secretary Liam Fox said he was saddened by the "tragic incident."
Police said officers were attempting to contact relatives of the dead and injured servicemen following the shooting, which took place at around 11:10 a.m. GMT (7:10 a.m. EDT).
Submariners do not usually carry loaded firearms aboard ship.
The sub, which is based in Scotland, was on a five-day visit to Southampton. Three local dignitaries, including the city's mayor and the leader of the city council, were aboard the ship at the time of the shooting, but were unharmed.
"We can confirm they are safe and unharmed and should be coming off and taken away by car soon. They have clearly been through a traumatic experience," the council said in a statement.
The 1 billion pound (US$1.6 billion) vessel is one of Britain's fleet of 11 submarines powered by nuclear reactors. Launched in 2007, it is armed with Spearfish torpedoes and Tomahawk cruise missile.
The vessel's commander was removed from his post after the Astute hit rocks and ran aground in late October near the Isle of Skye off the west coast of Scotland. It was stuck for several hours until it was towed to safety.
The defense ministry said it planned to open a Royal Navy investigation into the shooting.