(CNN) The two officers in charge of the destroyer USS John S. McCain have been relieved of duty after a deadly accident earlier this year, the US Navy said in a statement Tuesday.

The guided-missile destroyer collided with a merchant ship off Singapore on August 21, leaving 10 US sailors dead and five more injured. The accident left a large highly visible hole in the US ship.

The McCain's commanding officer, Cmdr. Alfredo J. Sanchez, and executive officer, Cmdr. Jessie L. Sanchez, were "relieved due to a loss of confidence," according to statement from the US 7th Fleet in Yokosuka, Japan, the ship's home port.

"While the investigation is ongoing, it is evident the collision was preventable, the commanding officer exercised poor judgment, and the executive officer exercised poor leadership of the ship's training program," the statement said.

Both officers were assigned to other duties in Japan.