Two senior commanders have been reprimanded after admitting that their negligence caused a nuclear submarine to run aground off Skye.
HMS Trafalgar was taking part in a training exercise
A court martial had been told that the commanders were simulating hazards for students on a training exercise.
The submarine, HMS Trafalgar, sustained millions of pounds worth of damage.
Commander Robert Fancy and Commander Ian McGhie were told that the sentences would remain on their records for five years.
The hearing at Portsmouth Naval Base heard that the accident caused three crewmen to be injured.
Naval prosecutor Lieutenant Commander Alison Towler described how the submarine ploughed into the seabed off a small island called Fladda-Chuain.
She told the hearing that Cdr Fancy had responsibility for navigation, while Cdr McGhie had overall command of the training course.
The court martial was told that the two commanders had agreed to make the task more difficult for a trainee, Lieutenant Commander Tim Green.
They did this by removing some of the navigational aids as well as forcing the submarine to go deeper underwater.
Lt Cdr Towler said: "At the time when the submarine became most vulnerable, deep dived and without the use of navigational aids, Cdr Fancy became distracted from concentrating on the navigation of the submarine."
Defending Cdr Fancy, Commander Stephen Taylor said: "Cdr Fancy fully accepts, as he has done right from the start, that he made certain errors and these errors meant his submarine was endangered."
He added that Cdr Fancy was now the commanding officer of another submarine, as well as commander of the Devonport Flotilla.
The hearing was told that Cdr McGhie was removed from his post as commanding officer of the training course and now works for the Ministry of Defence in London.
It had been decided not to discipline the trainee, Lt Cdr Green, by court martial but instead by administrative censure.
The court martial panel sentenced Cdr Fancy to a severe reprimand while Cdr McGhie was given a reprimand.