In the United States, commander is a military rank that is also sometimes used as a military billet title — the designation of someone who manages living quarters or a base — depending on the branch of service. It's also (sometimes) used as a rank or title in non-military organizations; particularly in law enforcement.
The commander rank started out as "Master and Commander" in 1674 within the British Navy for the officer responsible for sailing a ship under the Captain and some times second-in-command. Sub-captain, under-captain, rector and master-commanding was also used for the same position. With the Master and Commander also serving as captain of smaller ships the British Navy subsumed as the third and lowest of three grades of captain given the various sizes of ships. The American Continental Navy adopted the tri-graded captain ranks. Captain 2nd Grade, or Master Commandant, became Commander in 1838.
US Coast Guard
NOAA Commissioned Officer Corps
US Public Health Service Commissioned Corps
Rank insignia for the four Uniformed Services that use the rank of commander
A commander in the U.S. Navy may command a frigate, destroyer, submarine, aviation squadron or small shore activity, or may serve on a staff afloat or ashore (typically as an action officer or as an executive officer to a flag officer or general officer), or a larger vessel afloat (as either a department head or executive officer). An officer in the rank of commander who commands a vessel may also be referred to as "captain" as a courtesy title, or informally referred to as "skipper". Commanding officers of aviation squadrons and shore activities may also be informally referred to as "skipper" but never as "captain."
Although it exists largely as a maritime training organization, the U.S. Maritime Service also has the grade of commander. The commission is appointed by the President via the Secretary of Transportation, making it a federally recognized rank with a corresponding paygrade.
In addition to its use as a rank title, the U.S. Navy also uses commander as a "position title" for senior captains or flag officers in command of multiple independent units, each with their own "commanding officer". For example, the senior officer in a U.S. Navy aviation squadron is the "commanding officer" (CO) because he or she is in command of that singular unit. That officer's immediate superior in command (ISIC) will likely be an air group or air wing "commander", with the latter being responsible for multiple squadrons. This is in keeping with the naval tradition of "commanding officers" commanding single units, but "commanders" commanding multiple units.
U.S. police ranks
The Los Angeles Police Department was one of the first American police departments to use this rank. A commander in the LAPD is equivalent to an inspector in other U.S. police departments (such as the New York City Police Department); the LAPD rank was originally called inspector as well, but was changed in 1974 to commander after senior officers voiced a preference for the more military-sounding rank. A commander is the third-highest rank in the force, above the rank of captain and below deputy chief. Duties are as commanding officer of Community Affairs, Internal Affairs, Governmental Liaison, Narcotics, Organized Crime and Vice, Criminal Intelligence, Detective Services, and other departments.
The Rochester Police Department uses the rank of commander. Higher than captain and below deputy chief, the rank is achieved by appointment. Commander is the rank held by the two patrol division heads and other commanders fill various administrative roles. The Saint Paul Police Department is another police force that uses the rank of commander. In the Saint Paul Police Department, commanders serve as the chief of the district/unit that they oversee.
Many police departments in the Midwest use the rank of commander. It is equivalent to a lieutenant in most other departments, being above a sergeant and below a deputy chief or captain. Commander is also used as a title in certain circumstances, such as the commander of a squad of detectives, who would usually be of the rank of lieutenant.