A British sailor appeared in court on Monday accused of murdering a fellow seaman and the attempted murder of three other crew in a shooting on board a nuclear-powered submarine.

Ryan Donovan, 22, spoke only to confirm his name, age and address at the brief hearing at the court in Southampton, the southern English city where the shooting took place on Friday while the submarine HMS Astute was in dock.

Donovan, whose rank is able seaman, has been charged with the murder of Lieutenant Commander Ian Molyneux, 36 on board the submarine, which is the Royal Navy’s newest and most advanced.

He has further been charged of the attempted murder of Lieutenant Commander Christopher Hodge, 45, Chief Petty Officer David McCoy, 37, and Petty Officer Christopher Brown, 36.

Describing the allegation against Donovan, prosecutor Nick Hawkins said: “The prosecution claims it was the deliberate discharge of a SA80 rifle six times, aimed at four people, one of which was fatally wounded.”

He added that the case could have been handled internally by the armed forces but agreement had been reached to hold it in civilian courts.

Donovan was remanded in custody and will appear in court in the southern English city of Winchester on Wednesday.

The shootings happened as local politicians were being shown around the vessel during its five-day visit to Southampton.

Royston Smith, leader of the local council, tackled the gunman before he could empty his rifle.

HMS Astute, which is almost 328 feet (100 metres) long, was launched by Prince Charles’ wife Camilla, the Duchess of Cornwall, in June 2007 but was only deployed in August last year.

The submarine has been cleared to leave Southampton later on Monday to return to its base at Faslane, western Scotland.