WASHINGTON — In 2008, Barack Obama was the toast of Wall Street. The nation's biggest banks were among the most lavish contributors to the Democratic upstart's presidential campaign.

But so far in the 2012 race, the six largest U.S. banks have switched sides in a dramatic way, and are giving far more money to GOP hopeful Mitt Romney than they are to the sitting president, according to the most recent campaign-finance reports.

While the fund-raising numbers are not necessarily cause for concern at the White House — Obama has raised more than two and half times as much cash as Romney overall — they offer a vivid illustration of how the president's first 30 months in office have fractured what was once a warm relationship with the largest American banks.

"You could sum it all up in a hyphenated word: Dodd-Frank," said Larry Sabato, director of the Center for Politics at the University of Virginia, referring to last year's financial reform law. "It's no accident that Romney has now called for total repeal. Bankers generally feel pretty put upon by the Obama administration."

Prior to the 2008 election, Goldman Sachs and its employees gave more than four times as much money to Obama as they gave to Republican John McCain. In 2011, the ratio at Goldman has sharply reversed: more than six dollars to Romney for every one dollar to Obama, according to data obtained from the Center for Responsive Politics. The Washington-based nonprofit organization's data includes contributions from the banks' political action committees and bank employees.

There is plenty of time for that trend to reverse, but so far, similar stories are playing out elsewhere on Wall Street. At Morgan Stanley, which four years ago favored Obama to McCain by nearly a two-to-one margin, Obama now trails Romney by more than five to one. Through June 30, Obama raised less cash from Morgan Stanley and its employees than Tim Pawlenty, who has since dropped out of the race for the Republican nomination.

At the largest commercial banks, the swing is not quite as extreme. But Romney leads Obama in fund-raising at JPMorgan Chase, Bank of America, Citigroup, and Wells Fargo, whereas in 2008 Obama raised nearly four times as much cash from those four institutions than McCain did.

Representatives of the six banks either declined to comment on the partisan shift in contributions or did not respond to interview requests. Obama's reelection campaign also did not respond to a request for comment.

Scott Talbott, senior vice president for government affairs at the Financial Services Roundtable, a lobbying organization whose members include four of the six largest banks, said that one reason for the partisan shift in contributions involves what he characterized as "pretty heated" rhetoric toward banks from members of the Obama administration.

When Obama appeared on "60 Minutes" in December 2009, he said: "I did not run for office to be helping out a bunch of fat cat bankers on Wall Street."

Though he struck a more conciliatory tone during a meeting with bankers the day after the interview aired, the soundbite stuck.

"That characterization captured it," Talbott said. "But it wasn't just the president. It was the administration broadly."

In explaining the shift in contributions, Talbott also pointed to what he described as an "anti-business" environment.

"The overall regulatory environment, and not just Dodd-Frank, but the overall regulatory environment, has made it very hard for us to conduct business," Talbott said.

Many bankers are still particularly angry about Dodd-Frank, which they view as regulatory overkill. The candidates' views on the regulatory reform law may help explain banks' campaign donation patterns. While Obama has touted Dodd-Frank as a key achievement of his first term, Romney has been critical of the law.

Last week, he upped the ante by suggesting it was time to repeal it.

"I'd like to repeal Dodd-Frank, recognizing that some revisions make sense," Romney said at a campaign stop in New Hampshire, according to the Boston Globe. "The extent of regulation in the banking industry has become extraordinarily burdensome following Dodd-Frank."

But Dean Baker, an economist who is co-director of the Center for Economic and Policy Research in Washington, said Obama is getting a bad rap from bankers.

"I think Obama's really bent over backwards to be friendly to the business community," he said.

Baker argued that the banks' 2008 spending patterns reflected the fact that Obama seemed like a more competent manager of the economy than McCain. He also said that Wall Street may have been hedging its bets by giving to a Democrat at a time of great economic uncertainty.

"They probably felt that was a sound investment, and it may well have been," Baker said.

The shift in giving by the six largest banks is in line with a broader industry-wide trend. In the 2008 campaign, securities and investment firms, commercial banks and other miscellaneous finance firms gave about $1.50 to Obama for every dollar they gave to McCain, according to data from the Center for Responsive Politics.

So far in the 2012 campaign, those same firms are giving about $2.50 to Romney for every dollar they give to Obama.

The trend in favor of the GOP also extends to congressional races.

In 2008, 79% of all of Goldman Sachs' federal campaign contributions went to Democrats. That figure dropped to 34% in 2010 and to 33% so far in 2012. Similar, though less precipitous, drops occurred at Morgan Stanley, JPMorgan Chase, and Bank of America.

Citigroup is an exception. In 2008, 63% of its contributions went to Democrats. That figure fell to 35% in 2010, but it has risen back to 62% so far in the 2012 election cycle.