President Bush yesterday signed into law the long-awaited bill to create the Department of Homeland Security, a Cabinet-level super-agency that will combine 22 separate federal agencies to protect the United States from terrorism, and nominated former Pennsylvania governor Tom Ridge as its secretary.

Ridge, who has advised Bush on homeland defense for the past year as head of the Office of Homeland Security, now faces the mammoth task of melding together federal organizations with unique and at times conflicting mandates, traditions and cultures.

"We're taking historic action to defend the United States and protect our citizens from the dangers of a new era," Bush said at a White House signing ceremony. "We're showing the resolve of this great nation to defend our freedom, our security and our way of life."

Ridge will take office on Jan. 24, assuming quick confirmation by the Senate, and begin appointing top subordinates, and on March 1 a number of the component agencies will be transferred into the new department. All the agencies will be merged into the department by Sept. 30, 2003.

Bush nominated two other senior members of his administration to join Ridge in the new agency: Navy Secretary Gordon England to be Ridge's deputy secretary; and Asa Hutchinson, currently the administrator of the Drug Enforcement Administration and formerly a House member from Arkansas, to head the division that oversees border and transportation security.

Bush initially resisted calls to establish a homeland security department, but changed his mind last summer as congressional pressure grew and as criticism mounted of the performance of the CIA and the FBI before the Sept. 11, 2001, attacks. Ridge had said for months that he was not seeking the job of secretary of the new agency, but he too reversed course and ended up working for the appointment, government sources said.

Legislation to create the new department was delayed for months by Senate Democrats who resisted demands by Bush for new authority to establish workforce rules for the department's employees. This month's election, which gave Republicans control of the Senate, guaranteed a victory for Bush on the issue and Democrats quickly relented.

The new department will have 170,000 employees and bring together such agencies as the Immigration and Naturalization Service, the Secret Service, the Customs Service, the Federal Emergency Management Agency, the Transportation Security Administration and the Border Patrol.

It will analyze terrorism intelligence to match it against the nation's vulnerabilities, develop new technologies to detect threats, coordinate the training and funding of state and local police and fire departments, and scrutinize U.S. borders and ports of entry.

A number of the largest agencies -- the Coast Guard, the Secret Service, Customs, the INS and the Transportation Security Administration -- will transfer to the new department on March 1, according to the master plan. Other agencies will make the move later; the Agriculture Department's Plum Island Animal Disease Center, among others, will join the department June 1.

Among the key tasks facing Ridge in coming weeks is making the various agencies' computer and e-mail systems compatible, and consolidating their numerous terrorist watch lists. Management experts said it will take years to blend the various agencies into a smoothly functioning operation and unify their conflicting pension, retirement and payroll systems.

"Melding all of this together is going to take a remarkable management performance -- a management virtuoso," said Lee H. Hamilton, the former House Democrat and foreign policy expert who is now director of the Woodrow Wilson International Center for Scholars.

The legislation signed by Bush required the administration to submit to Congress within 60 days a detailed master plan on how it anticipates creating the department. But Bush signed off on that document and sent it to Congress yesterday, several days earlier than officials had earlier suggested they could deliver it.

Creation of the department was supported by both parties in Congress, but some Democrats yesterday continued to complain that Bush has vetoed or discouraged action on a number of Democratic initiatives to increase funding for domestic security. The office of Rep. David R. Obey (D-Wis.) yesterday released a list of proposed homeland security spending increases that Bush has refused to fund, including bioterrorism training for first responders and cyber-security measures.

An array of privacy advocates and civil liberties groups said yesterday they believe the new department is part of an alarming trend by the administration to collect information about U.S. citizens while simultaneously restricting the amount of information the government discloses to the public.

Representatives of the American Civil Liberties Union, the Federation of American Scientists and the Electronic Privacy Information Center said the new department could create advisory committees that are exempt from public disclosure laws. The legislation creating the department also shields from public disclosure information that industry might share with the government about critical infrastructure.

The goal is to allow industries with facilities that might be terrorist targets to share details with the government without fear of public disclosure. But the new law prevents the government from taking action against any company that provides such data, even if it contains evidence of wrongdoing by the company. In an analysis released last week, Sen. Patrick J. Leahy (D-Vt.), said the provisions "gut" the federal Freedom of Information Act.

Staff writers Mike Allen and Jonathan Krim contributed to this report.

President Bush addresses retiring Rep. Richard K. Armey (R-Tex.), right, in his remarks prior to signing the bill creating the Department of Homeland Security. Also present at the White House ceremony were Sen. Fred D. Thompson (R-Tenn.), behind Bush, and Rep. Tom DeLay (R-Tex.), left, the incoming House majority leader.Flanked by representatives of both parties, President Bush signs the bill creating the Department of Homeland Security. From left are Rep. Tom DeLay (R-Tex.), Sen. Joseph I. Lieberman (D-Conn.), Rep. Ellen Tauscher (D-Calif.), Rep. Richard K. Armey (R-Tex.), Sen. Zell Miller (D-Ga.) and Sen. Don Nickles (R-Okla.).