The duties of commander-in-chief of the "Army and Navy of the United States" (Section 2, Clause 1, US Constitution) are continuously vested in the president, whether during war or peace. This point was clarified by the Surrogate Court of Duchess County, New York in the matter of the disposition of...
The duties of commander-in-chief of the "Army and Navy of the United States" (Section 2, Clause 1, US Constitution) are continuously vested in the president, whether during war or peace. This point was clarified by the Surrogate Court of Duchess County, New York in the matter of the disposition of the estate of Franklin Roosevelt, when it ruled that
the President’s duties as Commander in Chief represent only a part of duties ex officio as Chief Executive and that the latter’s office is a civil office.
In other words, unlike the ancient Roman Republic in which one of the Consuls would be elevated to the office of "Dictator" at the onset of a war or emergency, the President retains supremacy as commander-in-chief of the armed forces at all times and can initiate military action independent of Congress when expediency is required, such as that imagined by the Caroline Doctrine in international law.
War, once declared, can be ended legally or practically.
War, in practice, is ended by the decision of the President and the military officers commissioned by him, to terminate its prosecution through the cessation of active military operations. A state of war is legally ended by a new resolution of Congress declaring the war over, or more commonly, the ratification of a peace treaty incorporating similar language. Further, with its power of the purse, Congress can force the actual termination of military operations by suspending funding for that purpose.
The practical and legal end of a war may be separated by many days, months, or years. A case in point is the US declaration of war against Austria-Hungary during World War I. In that instance, the President terminated active military measures against the successor states of Austria-Hungary in 1918. However, it was not until a series of peace treaties were signed and ratified by the United States in 1921 that the war formally concluded.