This is from the US Coast Guard Offical Web page, wich is also a .mil page:
"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.
As members of a military service, Guardians on active duty and in the Reserve are subject to the Uniform Code of Military Justice and receive the same pay and allowances as members of the same pay grades in the other four armed services."