The Homeland Security Act (HSA) of 2002, (Pub. L. 107–296 (text) (PDF), 116 Stat. 2135, enacted November 25, 2002) was introduced in the aftermath of the September 11 attacks and subsequent mailings of anthrax spores. The HSA was cosponsored by 118 members of Congress. The act passed the U.S. Senate by a vote of 90–9, with one Senator not voting. It was signed into law by President George W. Bush in November 2002.
 HSA created the United States Department of Homeland Security and the new cabinet-level position of Secretary of Homeland Security. It is the largest federal government reorganization since the Department of Defense was created via the National Security Act of 1947 (as amended in 1949).   It also includes many of the organizations under which the powers of the USA PATRIOT Act are exercised.
 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. A major reason for the implementation of HSA is to ensure that the border function remains strong within the new Department.
 The Act is similar to the Intelligence Reform and Terrorism Prevention Act (IRTPA) in reorganizing and centralizing Federal security functions to meet post–Cold War threats and challenges. Like IRTPA, there are some inherent contradictions in the bill not solved by reorganization.  These reflect compromises with other committees needed to secure passage, but the result is at times inconsistent or conflicting authorities.  For example, the Act identifies the Department of Homeland Security's (DHS) first responsibility as preventing terrorist attacks in the United States; but, the law's language makes clear that investigation and prosecution of terrorism remains with the Federal Bureau of Investigation and assigns DHS only an analytical and advisory role in intelligence activities.  Similarly, with Critical Infrastructure Protection (CIP), which relates to the preparedness and response to serious incidents, the Act gave DHS broad responsibility to minimize damage but only limited authority to share information and to coordinate the development of private sector best practices.
 The Homeland Security Act of 2002 is the foundation for many other establishments, including:
 The Homeland Security Act of 2002 documented under Public Law is divided into 17 titles that establishes the Department of Homeland Security and other purposes. Each title is broken down into several sections, summarized below.
 The United States Department of Homeland Security (DHS), formed November 25, 2002 through the Homeland Security Act, is a Cabinet department composed of several different divisions that work to protect the United States from domestic and foreign terrorism. It was created as a response to the September 11 attacks in 2001. The Department of Homeland Security manages the Emergency Preparedness and Response Directorate. The directorate helps fulfill the Department's overarching goal: to keep America safe from terrorist attacks. The Department also works to enhance preparedness and response efforts and to integrate these efforts with prevention work. With the Homeland Security Act there are several provisions that identify the specific duties for the EP&R Directorate.
 The Homeland Security Act contains several provisions that identify specific duties for the EP&R Directorate. Title V and Title II outline the way the department ensures  that the use of intelligence and its own threat analysis of terrorist capabilities are intended to distribute funds to those areas where the terrorist threat is greatest, and that states provide the Federal Government with their Emergency Response Plans so that the department can coordinate priorities regionally and nationally.