Kerry called passage of the finance bill a victory for Massachusetts. “Our workers and our businesses took it on the chin when Wall Street melted down,’’ Kerry said. “These reforms will fix what’s most broken, and Chairman Frank, Senator Brown, and I also worked collegially to ensure that Massachusetts’ financial firms, which did no harm, will continue to create jobs and engage in legitimate enterprise.’’

He did so by working closely with the Massachusetts delegation and leaning on some of its most liberal members, including Frank and Kerry.

Brown came to Washington in February amid predictions by some that he would be the crucial 41st senator to join the Republican effort to stop the Democrats’ health care agenda via filibuster, in which 60 votes are required to halt debate. On the financial regulation bill, Brown did the opposite — providing the 60th vote that Democrats were seeking to advance one of their major initiatives.

But other Republicans expressed dismay at the bill’s passage. Senator Judd Gregg of New Hampshire, called the creation of a Consumer Financial Protection Bureau “a massive expansion of the federal government’’ and said the bill “will do considerable damage to our competitiveness as a nation, not to mention harming job growth and our economic recovery.’’

“I’m satisfied that all of our efforts — Senator Kerry and my efforts — will benefit and protect jobs in Massachusetts,’’ Brown said yesterday.

In the hours before the final vote, much of the focus yesterday was on Brown’s role in enabling the legislation to go forward. A day earlier, Brown had opposed such efforts. His change followed a day of negotiations during which he interrupted Representative Barney Frank in the House members’ gym and discussed the bill with Senator John F. Kerry during a 40-mile bike ride.

“The recession we’re emerging from was primarily caused by a lack of responsibility and accountability from Wall Street to Washington,’’ Obama said yesterday in the Rose Garden, when it became clear final passage was imminent. “That’s why I made passage of Wall Street reform one of my top priorities as president, so that a crisis like this does not happen again.’’

The measure, which needs to be reconciled with a House version, provided Democrats with another razor-thin but significant victory on the heels of the recent passage of the health care overhaul. President Obama, who proposed his version of the legislation in June 2009, hailed the passage as a milestone.

Brown, the Massachusetts Republican, played a key role in its passage after he received assurances that the legislation would be altered to help a number of Bay State-based financial institutions. He joined two other Republicans and 57 Democrats to vote to shut off debate yesterday, paving the way for a final vote on the bill. The legislation later passed by a 59-to-39 tally, with Brown supporting it.

WASHINGTON — With a crucial last-minute boost from Senator Scott Brown, the Senate approved sweeping legislation last night that would restructure the nation’s financial industry, adding new safeguards and consumer protections in an effort to prevent another economic catastrophe.

Brown’s vote yesterday on the procedural measure to stop debate and move toward a final roll call was crucial. Two other Republicans — Senators Susan M. Collins and Olympia J. Snowe, both of Maine — joined the Democrats in voting to shut off debate. Two Democrats — Maria Cantwell of Washington and Russ Feingold of Wisconsin — joined Republicans in trying to block a final vote.

The financial overhaul legislation is designed to crack down on some of the risky practices that contributed to the meltdown of 2008. It would create a consumer protection bureau that seeks to help people avoid trouble with mortgages and credit cards they cannot afford. It would also establish a council that would be charged with monitoring the system for potential problems.

Brown has been withholding support for the bill until he was assured that some of the insurance and mutual fund companies in Massachusetts would not fall under the so-called Volcker rule, named after former Federal Reserve chairman Paul Volcker, which could restrict the investment options of large institutions, including preventing them from owning private equity funds. Brown also wanted to ensure that the legislation would not affect financial institutions that hold trust banks, allowing them to continue sponsoring investment funds as part of their asset management business.

Brown argued that those restrictions should be designed to curtail the risky bets placed by big Wall Street firms, not the more traditional practices of the Massachusetts-based companies.

Those concerns were aired during a lobbying effort by major firms in Massachusetts such as Fidelity, Putnam Investments, State Street Corp. , Liberty Mutual, and MassMutual. The institutions feared they would be included in regulations that would crack down on lending and investment practices. The firms were generally pleased with the House version of the bill, which Frank drafted, but had concerns with the Senate bill.

“Our concern has been that some proposal would have unintended consequences and restrict well-run entities in Massachusetts,’’ said Vin Loporchio, a spokesman for Fidelity. “We are hopeful that the final legislation will avoid a one-size-fits-all approach to regulation.’’

Brown and his aides had been working on the concerns for several weeks, but activity intensified over the past several days as the bill headed toward a vote.

Brown had initially told the Democratic leadership he would vote with Democrats to cut off debate, but then backed out late Wednesday afternoon when the changes he demanded to protect Massachusetts companies were not made. As a result, Senate majority leader Harry Reid accused Brown, though not by name, of breaking his word.

Brown called Frank on Wednesday night about the measure. Frank, working out on an elliptical machine in the House members’ gym, initially didn’t answer his phone. The two Massachusetts lawmakers — one a gruff, liberal Democrat who invites scorn from conservatives; the other a truck-driving Republican who won a surprising election with support from Tea Party movement conservatives — spoke several minutes later.

Frank assured Brown that he would protect the Massachusetts businesses in the final legislation. Frank — chairman of the House Committee on Financial Services and the top negotiator in reconciling differences between the House and Senate — then wrote to other key players. “All of these measures are important to our state and none of them threaten or weaken the broad objectives of comprehensive reform that guided our work, and I will insist that they be maintained in the final bill,’’ Frank wrote.

Then, at 6 a.m. yesterday, Brown met Kerry at his home in Georgetown, and the two senators went on a 40-mile bike ride, literally wheeling and dealing, to Great Falls, Md., and back. Kerry had been asked by Reid to try to win over Brown.

Brown’s campaign was well funded by financial interests. In the final days before the January special election, he received $450,000 from donors who work at financial companies, the Globe reported in February. Brown’s spokeswoman, Gail Gitcho, did not dispute the figure, but said Brown raised $15 million, with an average donation of $80.

After the final vote was recorded, Brown rushed out of the chamber to catch a flight. Asked for comment, he responded, “I’m done making news today.’’

Matt Viser can be reached at maviser@globe.com.

© Copyright 2010 Globe Newspaper Company.