From wiki:
The term "commander-in-chief" derives from the Latin imperator. Imperatores (commanders-in-chief) of the Roman Republic and Roman Empire possessed imperium (command) powers. In its modern usage, the term was first used by King Charles I of England in 1639. A nation's head of state usually holds the position of national commander-in-chief, even if effective executive power is held by a separate head of government. Colonial governors are also often appointed commander-in-chief of the military forces in their colonies. in-Chief Allied Forces North, Commander-in-Chief East Atlantic, etc.