In many militaries, an executive officer (or simply X.O.) was the second-in-command of a single military unit and reported directly to the commanding officer (or C.O.). The X.O. was typically responsible for the management of day-to-day activities within the unit in order to free the commander to concentrate on either planning the unit's next move or issuing general orders as circumstances dictated. The X.O. would also take charge of the unit in the absence of the commander (either due to being on leave, incapacitated in some fashion, or killed in the line of duty, among other possibilities). The position was frequently the stepping-stone to a command position for the officer.

Some organizations used the term "Second-in-Command," First Mate," or "First Officer" to describe an X.O., including paramilitary and non-military entities such as civilian starships or pirate and/or smuggling organizations.