The House passed a measure to overhaul the nation's food-safety laws by a vote of 215 to 144 Tuesday afternoon, and President Obama is expected to sign it into law as soon as Wednesday.

The vote marked the final hurdle for a bill that cleared an unusual number of obstacles, despite enjoying bipartisan support and backing from a wide array of groups across the political spectrum, from the Consumers Union to the Chamber of Commerce.

"This is a big victory for consumers that finally brings food-safety laws into the 21st century," said Jean Halloran of Consumers Union. "This win is a powerful testament to the people across the country who came to Washington to tell their lawmakers how contaminated food had killed their loved ones or left them horribly sick. This win is for them and all Americans."

But some critics said the new legislation will expand the reach of the federal government without making food safer. "The federal food bureaucracy needs to get smarter and better coordinated, not more omnipotent," said Rep. Tom Price (R-Ga.).

The proposal survived filibuster threats in the Senate, constitutional confusion and tensions between big agricultural companies and the burgeoning local food movement.

The setbacks repeatedly sent the bill back to both chambers, where new challenges arose. In the end, the House voted on it three times and the Senate twice.

The legislation will affect all whole and processed foods except meat, poultry and some egg products, which are regulated by the U.S. Department of Agriculture.

It is the first major change to the nation's food safety laws since 1938, and comes after a series of national outbreaks of food-borne illnesses linked to a wide varietyof foods, including spinach, peanuts and eggs.

"I beg you, the safety of your constituents is at stake," Rep. John D. Dingell (D-Mich.) said during debate on the House floor.

Unlike the current system, which relies on federal officials to trace the source of an outbreak to its origin after consumers have become ill, the new requirements are designed to create a system in which manufacturers and farmers come up with strategies to prevent contamination, then continually test to make sure they work.

The bill includes an exemption for small farmers and food processors, and those who sell directly to the public at farmers markets and farm stands. That exemption was pushed by advocates for local food, who argued that small producers would not be able to afford the testing and record-keeping required by the legislation. But it drew objections from major agricultural producers, which argued that no one should be exempt from producing safe food.

The exemptions "will limit the ability of the [Food and Drug Administration] to assure consumers that all foods they purchase, whether at grocery stores, restaurants, farm markets or elsewhere, have met the same food-safety standards," said Robert Guenther of United Fresh Produce Association, which represents the major fruit and vegetable growers.

"We remain fearful that this profound error will come back to haunt Congress, public health agencies and even those who thought they would benefit from food safety exemptions, but more importantly, we are fearful of what may slip through the food safety loopholes . . . and adversely affect consumers."

The measure also gives the FDA the authority to recall food; now, it must rely on food companies to voluntarily pull products off the shelves. And the bill would give the FDA access to internal records at farms and food-production facilities.

The bill would for the first time require importers to verify that their products from overseas meet U.S. safety standards.

One in six Americans becomes ill from tainted food each year, and 3,000 die, according to government estimates. Businesses spend billions of dollars as a result of lost sales, recalls and legal expenses triggered by the problem.

The measure is expected to cost $1.4 billion over the next four years, including the expense of hiring 2,000 new FDA inspectors.