HMS Astute was on sea trials last month when she became stuck off the coast of Skye and ended up marooned for several hours.
Navy officials have confirmed that Commander Andy Coles, 47, lost his command of the submarine. He will remain with the Royal Navy and is to be given another post.
A final decision has still to be made about whether Commander Coles will face a court martial over the incident.
A Royal Navy spokesman said: "He's going to continue with the Royal Navy. He will be reappointed to another post. It's an internal administrative matter between Commander Coles and his senior officers."
The spokesman said it was not known what the new post will be. He added that a new commanding officer of HMS Astute will be appointed in the near future.
The vessel ran aground on 22 October. It was freed by the evening when the tide began to rise.