The White House said Mr. Obama would sign the legislation next week.

Democrats, who celebrated with high fives and handshakes as the bill was packed in a blue box for delivery to the White House, argue that the government’s expanded role will improve the stability of the financial system without sapping its vitality. But that project faces considerable challenges. Many investors have withdrawn from markets like commercial paper that were once seen as safe. Lenders have lost faith in borrowers. Politicians and central bankers are struggling to repair economies and restore the flow of credit.

Even the bill’s political luster no longer seems certain. Despite public anger at Wall Street, the vast majority of Republicans opposed the bill with loud confidence, betting ahead of hotly contested midterm elections that the public dislikes government even more.

Senator Richard Shelby, Republican of Alabama, described the bill as “a 2,300-page legislative monster.”

“It creates vast new bureaucracies with little accountability and seriously, I believe, undermines the competitiveness of the American economy,” Mr. Shelby said on the Senate floor before the final vote. “Unfortunately, the bill does very little to make our system safer.”

The three Republicans who voted in favor were New England moderates, Olympia J. Snowe and Susan Collins of Maine and Scott Brown of Massachusetts. The one Democratic holdout was Russ Feingold of Wisconsin, who said he voted against the bill because it was not tough enough.

The bill expands federal banking and securities regulation from its focus on banks and public markets, subjecting a wider range of financial companies to government oversight, and imposing regulation for the first time on “black markets” like the enormous trade in credit derivatives.

Image Senator Christopher J. Dodd, right, and Representative Barney Frank, shown in May, are the chief authors of the bill mandating a sweeping overhaul of the nation’s financial regulatory system. Credit... Alex Wong/Getty Images

It creates a council of federal regulators, led by the Treasury secretary, to coordinate the detection of risks to the financial system, and it provides new powers to constrain and even dismantle troubled companies.