With the president sinking in public opinion polls that measure confidence in his economic leadership, Obama was certain to hail Senate passage of the legislation that is designed to head off a repeat of the near-collapse of the U.S. financial system shortly before he took office.

The bill has been Obama’s top domestic priority after the passage of health care legislation and his early victory in setting up a nearly $800 billion fund to pump life into an economy hit with the deepest downturn since the Great Depression of the 1930s.

The 2,300-page bill aims to address regulatory weaknesses blamed for the 2008 financial crisis. It gives regulators broad authority to rein in banks, limit risk-taking by financial firms and supervise previously unregulated trading. It also makes it easier to liquidate large, financially interconnected institutions, and it creates a new consumer protection bureau to guard against lending abuses.

The measure also includes new protections for millions of American consumers.

Only three opposition Republicans in the Senate backed the overhaul, a reflection of the party’s solidarity in bucking Obama’s legislative agenda. The measure has already passed in the House of Representatives, where Democrats hold a larger margin of votes.

Partisan rancor in the United States has reached levels seldom encountered in recent history, with Republicans apparently gambling that they could gain strength or even win back congressional majorities by erecting roadblocks to Obama’s reform agenda.

Republicans are widely expected to recapture many seats from the Democratic majority in both the House and Senate in congressional elections in November. Americans’ frustrations and fears spawned by near-10 percent unemployment and a sputtering economic recovery are playing into Republican hands.

The Republicans also have largely welcomed into their ranks ultraconservative tea party activists and candidates who promise to reduce government size and power by, in many cases, uprooting social welfare programs. Their political strategy has been to paint the new financial regulations just another symptom of government overreach.

Senate Banking Committee Chairman Chris Dodd, a Democrat who is retiring, negotiated several provisions with key committee Republicans such as Richard Shelby and Bob Corker. With a virulent anti-incumbent mood sweeping the nation, however, neither senator voted to vote for the bill.

Republicans were betting that the voters’ antipathy toward big government and their worries over jobs would trump their anger at Wall Street.

“Ultimately in November, people are going to be looking at the size and scope of the federal government, spending and debt and see that a lot of aspects of this bill make things worse in terms of getting America back to work rather than better,” said Sen. John Cornyn, the head of National Republican Senatorial Committee.

Democratic Sen. Chris Dodd, Senate Banking Committee chairman, praised party colleagues for their hard work and also offered thanks to Republicans, even those who voted “no,” for having added to the legislation during the long months of negotiations.

The legislation, among other things:

— Gives the government new powers to break up teetering companies whose failure would threaten the economy.

— Creates a new agency to guard consumers in their financial transactions.

— Shines a light into shadow financial markets that have escaped the oversight of regulators.

The bill’s many provisions don’t offer a quick remedy, however. Rather, they are a prescription for regulators to act. In many cases, the real impact of the legislation won’t be felt for at least two years.

“We have no idea whether this bill is historical or not,” Corker said. “We won’t know for a long time, until the regulators decide what they’re going to do with this bill.”