superior officer; commanding officer
Refers to a military or organizational superior; used in formal or hierarchical contexts.
上官の命令に従わなければならない。
You must obey the orders of your superior officer.
He was my superior officer.
彼は上官に昇進した。
He was promoted to a higher-ranking officer.
兵士は上官の命令に従わなければならない。
Soldiers must obey their superior officer's orders.
He reported the situation to his superior officer.
部下 means a subordinate, the direct opposite of 上官, a superior officer.
士官 refers to a commissioned officer's rank itself, whereas 上官 refers to whoever is above you in the chain of command, regardless of rank.
上官 specifically means a superior officer in the military or police, whereas 上司 is the general word for a boss in any workplace.
Compound of 上 (upper, superior) and 官 (official, officer).