WASHINGTON  The United States Navy removed the commanding officer of the aircraft carrier Enterprise on Tuesday, citing his “profound lack of good judgment” for creating and starring in a series of coarse and sexually explicit onboard videos several years ago that were meant as entertainment for the ship’s crew.

The officer, Capt. Owen Honors, was permanently relieved of his duties some two weeks before the Enterprise, the world’s first nuclear-powered carrier, is due to leave its home port in Norfolk, Va., to support combat missions in Afghanistan.

Adm. John C. Harvey Jr., the commander of the United States Fleet Forces Command in Norfolk, said in a statement that after viewing the videos, he had lost confidence in the captain’s ability to lead. Captain Honors’s lack of judgment and professionalism, the admiral said, “calls into question his character and completely undermines his credibility to continue to serve effectively in command.”