Perhaps no function of the president or chief state executive is more significant as indicating his independent and exalted position than that of being the commander-in-chief of the army and navy of the United States and of the militia of the several states when called into the actual service of the United States, in the case of the president (Const. Art. II, § 2, ¶ 1), or commander-in-chief of the state militia in the case of a state executive. As already indicated in the chapter relating to the war power (see above, § 114), Congress is authorized to make rules for the government and regulation of the land and naval forces, but the command of these forces and the enforcement of the rules for their government are vested in the president. The governor of a state is given similar authority with reference to the state militia. It is not intended that the president or a governor shall take active command of the military forces of the United States or of a state in time of hostilities. He is essentially a civil officer. But the military or war department is a branch of the executive department, and the chief executive is therefore necessarily its head.

As the head of the executive department, the power of declaring martial law, that is, of putting the military power for the time being in superiority to the civil power, is in the president, in the case of the United States, and in the governor in the case of a state. In the federal constitution this power is limited by the provision that "The privilege of the writ of habeas corpus shall not be suspended unless when in case of rebellion or invasion the public safety may require it" (Art. I, § 9, ¶ 2). The existence of martial law is regarded, however, as but a temporary condition arising from necessity. (See above, § 115.) The civil power of the government and the jurisdiction of its courts are not to be permanently abrogated, but so soon as the condition of necessity ceases to exist, the civil power, which has been temporarily suspended, is restored to supremacy.