A Royal Navy crewman has been shot dead and another is in a life-threatening condition after a shooting on board nuclear submarine HMS Astute.
A third Royal Navy serviceman was arrested after police were called to Southampton docks at 1212 BST.
A crew member shot two of his crew mates before being overpowered, it is believed.
The leader of Southampton City Council Royston Smith has told the BBC he wrestled the gunman to the ground.
Mr Royston said a total of six shots were fired by the gunman.
Eleven children were on the quayside at the time of the shooting and were due to board the submarine.
Police are interviewing 30 potential witnesses to what happened.
A spokesman for Southampton City Council confirmed its mayor Carol Cunio, chief executive Alistair Neill and Mr Smith were all on board at the time of the shooting in the vessel's control room.
The three, who were not injured, were not available for comment.
A police spokeswoman said the incident was not linked to terrorism.
She said there was no public safety risk and the area was sealed off.
BBC News understands the arrested man was handed over to Hampshire police by Ministry of Defence police.
An MoD spokesman said: "Two Royal Navy personnel have been involved in a firearms incident at Southampton docks where HMS Astute is alongside.
"Sadly, one has now died as a result of his injuries. The Royal Navy is now attempting to inform their families as a matter of urgency.
"A third Royal Navy serviceman has been arrested by Hampshire Constabulary and is now in custody."
Defence Secretary Liam Fox said: "I am greatly saddened to hear of this incident and of the death of a Royal Navy service person in this tragic incident.
"It is right and proper that a full police investigation is carried out and allowed to take its course.
"My thoughts and sympathies are with those who have been affected and their families."
Brian Cedar, who lives in Hythe marina, said: "I saw at least six people carry a stretcher off the gangway into a waiting ambulance.
"There were a couple of forensic people who have now left.
"If you can have a shooting like this on a nuclear submarine it is worrying."
All concerned family members are asked to call the MoD's Joint Casualty and Compassionate Centre on 0845 7800 900.
The 97m-long (318ft) HMS Astute, the UK's newest nuclear submarine, is based at the Faslane Naval Base on the Clyde.
It ran aground on a shingle bank between the Scottish mainland and the Isle of Skye in October last year and remained marooned for several hours.
HMS Astute was named and launched by the Duchess of Cornwall in June 2007 before being welcomed into the Royal Navy in August last year at a commissioning ceremony at Faslane Naval Base on the Clyde.
Its Spearfish torpedoes and Tomahawk cruise missiles are capable of delivering strikes from 2,000km (1,240 miles) with conventional weapons.
The submarine's nuclear reactor means it does not need refuelling and it makes its own air and water, enabling it to circumnavigate the globe without needing to surface.
The vessel has been berthed in Southampton since Wednesday for a five-day official visit.