The United States Coast Guard (USCG) is a branch of the United States Armed Forces and one of the country's seven uniformed services. The Coast Guard is a maritime, military, multi-mission service unique among the U.S. military branches for having a maritime law enforcement mission (with jurisdiction in both domestic and international waters) and a federal regulatory agency mission as part of its mission set. It operates under the U.S. Department of Homeland Security during peacetime, and can be transferred to the U.S. Department of the Navy by the U.S. President at any time, or by the U.S. Congress during times of war. This has happened twice, in 1917, during World War I, and in 1941, during World War II. 

Created by Congress on 4 August 1790 at the request of Alexander Hamilton as the Revenue Marine, it is the oldest continuous seagoing service of the United States. As Secretary of the Treasury, Hamilton headed the Revenue Marine, whose original purpose was collecting customs duties in the nation's seaports. By the 1860s, the service was known as the U.S. Revenue Cutter Service and the term Revenue Marine gradually fell into disuse. 

The modern Coast Guard was formed by a merger of the Revenue Cutter Service and the U.S. Life-Saving Service on 28 January 1915, under the U.S. Department of the Treasury. As one of the country's five armed services, the Coast Guard has been involved in every U.S. war from 1790 to the Iraq War and the War in Afghanistan. the Coast Guard had over 36,000 men and women on active duty, 7,350 reservists, 29,620 auxiliarists, and 7,064 full-time civilian employees. In terms of size, the U.S. Coast Guard by itself is the world's 12th largest naval force.
Who can change this during war?
 by the U.S. Congress during times of war