Congress has approved legislation to intensify anti-terror efforts in the United States, shifting money to high-risk states and cities and expanding screening of air and sea cargo. The measure carries out major recommendations of the Sept. 11 Commission.

The bill, passed by the House on a 371-40 vote Friday after the Senate approved the measure late Thursday by 85-8.

The White House said President Bush would sign the bill.

Six years after the Sept. 11 airline terror attacks and three years after the Sept. 11 Commission made its recommendations, "Congress is finally embracing what the 9/11 families have been saying all along," said Homeland Security Committee Chairman Bennie Thompson, a Democrat. "It takes a willingness to do things a different way."

The bill elevates the importance of risk factors in determining which states and cities get federal security money and puts money into a new program to assure that security officials at every level can communicate with each other.

It would require screening of all cargo on passenger planes within three years and sets a five-year goal of scanning all container ships for nuclear devices before they leave foreign ports.

Senate Homeland Security and Governmental Affairs Committee Chairman Joe Lieberman, an independent who steered the legislation through the Senate with Sen. Susan Collins, a Republican, said it would "make our nation stronger, our cities and towns more secure and our families safer."

Rep. Peter King, top Republican on the Homeland Security panel, said the bill "is another step in the right direction building on the steps of the previous 5 1/2 years."

"These efforts build upon the considerable progress we've made over the past six years," said White House spokesman Scott Stanzel.

Completion of the bill, six months after the House passed its original version on the first day of the current Congress.

The independent Sept. 11 Commission in 2004 issued 41 recommendations covering domestic security, intelligence gathering and foreign policy. Congress and the White House followed through on some, including creating a director of national intelligence, tightening land border screening and cracking down on terrorist financing.

Democrats, after taking over control of Congress, promised to make completing the list a top priority.

Former Rep. Lee Hamilton, a Democrat, the vice chairman of the Sept. 11 Commission, said with enactment of the bill some 80 percent of the panel's recommendations will have been met. "The bottom line is that the American people will be safer," he said.

The Sept. 11 bill led off the first busy legislative week in the House last January, and the Senate passed its version in March. The measure stalled after that, partly because of a White House veto threat over language, since dropped, to give collective bargaining rights to aviation screeners.

House-Senate negotiators finally reached an agreement this week after Democrats worked out a provision satisfying Republican demands that people who report what they in good faith believe to be terrorist activity around planes, trains and buses be protected from lawsuits.

The most controversial provision in the legislation requires the radiation scanning of cargo containers in more than 600 ports from which ships leave for the U.S. The White House, and other critics, say that the technology is not there, that the requirement could disrupt trade and that current procedures including manifest inspections at foreign ports and radiation monitoring in U.S. ports are working well.

Supporters argue that the unthinkable devastation from the detonation of a nuclear device in an American port makes it imperative to scan cargo before it reaches U.S. shores. As a compromise, it was agreed that the Homeland Security secretary can extend the five-year deadline for 100 percent scanning in two-year increments if necessary.