Specifically the commanding officer of a military vessel. Not used for civilian ship captains (船長).
The captain ordered the crew to general quarters.
He was appointed captain of a cruiser.
He serves as the captain of this submarine.
She became the youngest captain in history.
艦長 commands a warship, whereas 機長 is the captain (pilot-in-command) of an aircraft, so the two are easy to confuse by role but differ by vehicle type.
Used for people, especially in formal contexts such as positions, reservations, or seating.
Compound of 艦 (warship) and 長 (chief, head).