Military rank in the army or air force, equivalent to sergeant. Used in both historical and modern contexts.
彼は軍曹に昇進した。
He was promoted to sergeant.
He was promoted to sergeant after two years.
軍曹が部隊を指揮した。
The sergeant commanded the unit.
軍曹 is the army rank of sergeant, while 伍長 is one rank lower, equivalent to corporal.
From 軍 (army) and 曹 (official, rank). The exact historical derivation is uncertain, but the compound has been used for the sergeant rank in modern Japanese military terminology.