Flag officer
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. Those that were found within the highest echelons were generally regarded as military leaders.

History 
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.

Not all flag officers were required to have commanded a starship in their career, as shown by the case of Commodore Stocker. () 

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." () 

In the 23rd century, a procedure existed that if a Starfleet Admiral took command of a single starship, they would revert to the rank of Captain, displacing the current Captain who then reverted to the rank of Commander.  By 2285, this practice appears to have no longer been in place, given that when Admiral James T. Kirk assumed command of the USS Enterprise, he continued to be addressed as an Admiral and wear a flag officer's uniform, this having not been the case when he similarly had assumed command of the same ship in the 2270s. (, ) 

Starfleet General Order 15 stated that "No flag officer shall beam into a hazardous area without armed escort." ()

According to Captain Kathryn Janeway, with regard to the Omega molecule and Omega Directive, "Only starship captains and Federation flag officers have been briefed on the nature of this threat." ()

Flag officer ranks 
Andorian Imperial Guard
 General

Bajoran Militia
 General

Cardassian Guard
 Legate

Klingon Defense Force
 Fleet admiral
 General
 Brigadier

Romulan military
 General
 Admiral

Starfleet
 Fleet admiral
 Admiral
 Vice admiral
 Rear admiral
 Commodore 

United States Armed Forces
 General
 Lieutenant general

See also 
 Starfleet flag officers‎

External links 
 
 
de:Flaggoffizier
es:Oficial de bandera
ja:将官
nl:Vlagofficier
Titles