Updated

President Bush signed into law Friday a $400 million comprehensive port security bill designed to keep nuclear, chemical, or biological weapons out of the 11 million shipping containers that make their to the U.S. each year.

Tucked into the Security and Accountability for Every Port Act (SAFE) is the Unlawful Internet Gambling Act (UIGA), which is sure to anger the millions of people who play online poker. The UIGA would make it illegal for banks, credit card companies and other financial intermediaries to transfer funds to online gambling sites. It does not outlaw the sites, just makes it illegal to settle online wages.

"We're going to protect our ports. We're going to defend this homeland, and we're going to win this war on terror," Bush said at the signing ceremony, drawing attention to positive news for the Republican-led Congress on the homeland security front just weeks before the midterm elections. Bush did not mention the gambling provision.

He noted that the SAFE Port Act authorizes the development of high-tech inspection equipment so customs agents can check cargo containers for dangerous materials without having to open them. It requires radiation-detection technology at 22 of the nation's busiest ports by the end of next year.

"We'll do everything we can to prevent an attack, but if the terrorists succeed in launching an attack, we'll be ready to respond," Bush said.

The president said the bill codifies the Container Security Initiative, which deploys U.S. inspectors to dozens of foreign ports on five continents where they can screen cargo bound for the United States. He said it also codifies the Customs Trade Partnership Against Terrorism, a joint public-private sector initiative in which private shippers agree to improve their own security measures and in return can receive benefits, including expedited clearance through U.S. ports.

Bush also noted that the bill provides additional authority for the Domestic Nuclear Detection Office, which was established to guard against the threat of terrorists smuggling a nuclear device into the country. And the act requires the Department of Homeland Security to establish a plan to speed the resumption of trade in the event of a terrorist attack on a U.S. port or waterway.

It is feared that a terrorist attack, such as a nuclear device set off by remote control, could cripple the entire economy as well as cause massive casualties.

"This bill makes clear that the federal government has the authority to clear waterways, identify cleanup equipment and re-establish the flow of commerce following a terrorist attack," the president said.

Congress approved the bill two weeks ago, one of its last acts before lawmakers left to campaign for the Nov. 7 midterm elections in which national security, the war in Iraq and terrorism are expected to be major factors.

The administration has spent about $10 billion to enhance security at the nation's ports since the attacks of Sept. 11, 2001. About 65 percent of cargo, that considered most high-risk, is screened for nuclear or radiological materials. The Homeland Security Department aims to increase that number to 80 percent by the end of the year and to almost 100 percent by the end of 2007.

The issue became a particular priority for Congress after a fight in February over a buyout that put a Dubai company in control of some operations at six U.S. ports. The outcry led the Dubai company, DP World, to promise it would sell the U.S. operations to an American company. The sale is pending.

Democrats favored the bill, but said it failed to address rail and mass transit, other areas considered highly vulnerable to terrorist attack. The bill was approved on a 409-2 vote in the House, and by a voice vote in the Senate.

The legislation approves $400 million a year over five years for risk-based grants for training and exercises at ports.

Pilot programs would be established at three foreign ports to test technology for nonintrusive cargo inspections. Currently only one foreign port, Hong Kong, scans all U.S.-bound cargo for nuclear materials.

Background checks and credentials will be required for workers at the nation's 361 ports, and the Homeland Security Department would set up protocols for resuming operations after an attack or incident. Preferential cargo processing is offered to importers who meet certain security requirements.

The Internet gambling provision tackles the difficult task of enforcing bans by prohibiting players from using credit cards, checks and electronic fund transfers to settle their online wagers.

The measure's supporters include the National Football League as well as conservative and antigambling groups. Some banking groups have lobbied against it.

Federal officials have made recent arrests involving offshore companies operating Internet gambling sites. The Internet gambling industry is headquartered almost entirely outside the United States, although many of its customers live in the U.S.

The Associated Press contributed to this report.