The US Coast Guard is a military agency. It is in no way, shape or form a civilian agency. Diablo is correct, in that it was under the Dept. of Transportation while I was in and it is placed under the Dept. of the Navy during war or national emergency. It was transferred to the DHS when that agency was formed.
It is also the only fulltime active military agency in the US. The Army, Navy, Air Force and Marines are in training mode until directed to act. The Coast Guard is in active mode 24/7/365 with Law Enforcement, Search and Rescue and Aid to Navigation.
Just a side note, when Task Force Tarawa was sent to Iraq my old ship USCGC Boutwell was on point. It was also featured on "Mail Call" hosted by R.Lee Ermey.
HERE is an interesting article. Semper Paratus.