The legal basis for the Coast Guard is Title 14 of the United States Code, which states: "The Coast Guard as established January 28, 1915, shall be a military service and a branch of the armed forces of the United States at all times." Upon the declaration of war or when the President directs, the Coast Guard operates under the authority of the Department of the Navy.