The Homeland Security Act (HSA) of 2002, Pub. L. No. 107-296, 116 Stat. 2135 (Nov. 25, 2002), introduced in the aftermath of the September 11 attacks, created the United States Department of Homeland Security in the largest federal government reorganization since the Department of Defense was created via the National Security Act of 1947 (as amended in 1949). The HSA includes many of the organizations under which the powers of the USA PATRIOT Act are exercised. Among other things, it created the new cabinet-level position of Secretary of Homeland Security.
The new department assumed a large number of services, offices and other organizations previously conducted in other departments, such as the Customs Service, Coast Guard, and U.S. Secret Service. It superseded, but did not replace the Office of Homeland Security, which retained an advisory role. The Homeland Security Appropriations Act of 2004 provided the new department its first funding.