A flag officer was both a historic naval and military rank and a more modern Starfleet title. It generally referred to all officers of commodore/rear admiral rank or higher. The term flag officer stemmed from the historical naval practice that when a person of admiral rank was posted to a ship, a flag denoting his rank and presence was flown. In an age of visual signals, the ships under the admiral's command would look to the flagship for orders and instructions. The term traditionally denoted any officer that commanded a squadron of starships, possibly in addition to one under their direct command.
Starfleet regulations as of the mid-23rd century stated that "when a captain is unfit, physically or mentally, a competency hearing is mandatory," convened by the first officer and headed by a Starfleet flag officer. Additionally, when all senior officers are incapable of commanding a starship, an individual of "flag rank is forced by regulations to assume command." (TOS: "The Deadly Years")
According to Captain Kathryn Janeway, with regards to the Omega molecule and Omega Directive, "Only starship captains and Federation flag officers have been briefed on the nature of this threat." (VOY: "The Omega Directive")
Flag officer ranks in Starfleet
- Fleet admiral
- Vice admiral
- Rear admiral (aka rear admiral, upper half)
- Commodore (aka rear admiral, lower half)