WASHINGTON — A decade ago, Sen. John McCain embraced legislation to broadly deregulate the banking and insurance industries, helping to sweep aside a thicket of rules established over decades in favor of a less restricted financial marketplace that proponents said would result in greater economic growth.

Now, as the Bush administration scrambles to stabilize a tumultuous Wall Street, the Republican presidential nominee is scrambling to recast himself as a champion of regulation to end “reckless conduct, corruption and unbridled greed” on Wall Street.

“Government has a clear responsibility to act in defense of the public interest, and that’s exactly what I intend to do,” a fiery McCain said at a rally in Tampa on Tuesday. “In my administration, we’re going to hold people on Wall Street responsible. And we’re going to enact and enforce reforms to make sure that these outrages never happen in the first place.”

McCain hopes to tap into anger among voters who are looking for someone to blame for the economic meltdown that threatens their home values, bank accounts and 401(k) plans.

But his past support of congressional deregulation efforts and his arguments against “government interference” in the free market by federal, state and local officials have given Sen. Barack Obama an opening to press the advantage Democrats traditionally have in times of economic trouble.

In 2002, McCain introduced a bill to deregulate the broadband Internet market, warning that “the potential for government interference with market forces is not limited to federal regulation.” Three years earlier, McCain had joined with other Republicans to push through landmark legislation sponsored by then-Sen. Phil Gramm, R-Texas, who now is an economic adviser to his campaign. The Gramm-Leach-Bliley Act aimed to make the country’s financial institutions competitive by removing the Depression-era walls between banking, investment and insurance companies.

That bill allowed AIG to participate in the gold rush of a rapidly expanding global banking and investment market. But the legislation also helped pave the way for companies such as AIG and Lehman Brothers to become behemoths laden with bad loans and investments.

McCain now condemns the executives at those companies for pursuing the ambitions that the Gramm-Leach-Bliley Act made possible, saying that “in an endless quest for easy money, they dreamed up investment schemes that they themselves don’t even understand.”

He said the misconduct was aided by “casual oversight by regulatory agencies in Washington,” where he said oversight is “scattered, unfocused and ineffective.”

“They haven’t been doing their job right,” McCain said Tuesday, “or else we wouldn’t have these massive problems on Wall Street, and that’s a fact. At their worst, they’ve been caught up in Washington turf wars instead of working together to protect investors and the public interest.”

Tuesday, Obama seized on what he called McCain’s “newfound support for regulation” and accused his rival of supporting “a broken system in Washington that is breaking the American economy.”

In a speech in Golden, Colo., Obama blamed the economic crisis on an “economic philosophy” that he said McCain and President Bush supported blindly.

“John McCain has spent decades in Washington supporting financial institutions instead of their customers,” he told a crowd of about 2,100 at the Colorado School of Mines. “So let’s be clear: What we’ve seen the last few days is nothing less than the final verdict on an economic philosophy that has completely failed.”

Obama released a TV ad that mocks McCain for saying Monday that “the fundamentals of our economy are strong” and asks: “How can John McCain fix our economy if he doesn’t understand it’s broken?”

He also poked fun at McCain for proposing a commission to examine the crisis, calling that “the oldest Washington stunt in the book.”

“This isn’t 9/11. We know how we got into this mess,” Obama said. “What we need now is leadership that gets us out. I’ll provide it, John McCain won’t, and that’s the choice for the American people in this election.”

Obama reiterated his economic proposals: a stimulus plan and protections for struggling homeowners. Over the long term, he proposes enhancing regulations of the financial markets, including creating an advisory panel to regularly update the president.

McCain’s proposed changes for the system were equally vague.

“There will be constant access to the books and accounts of our banks and other financial institutions,” he said. “By law, it will reduce the debt and risk that any bank can take on. And above all, I promise reforms to prevent the kind of wild speculation that can put our markets at risk, and has already inflicted such enormous damage across our economy.”

McCain stumbled Monday when the financial crisis peaked, first saying the “fundamentals” of the economy were strong.

After being hammered by Obama and the Democrats — “What economy is he talking about?” Obama asked — he said that he knows the economy is in crisis, but that the basis of the American economy, the American worker, is strong.

By Tuesday, McCain had retooled the message further, and tried to wrap the financial meltdown into his campaign’s greater message about changing “the way Washington does business.”