WASHINGTON - On its face, the House vote late Thursday to approve a spending bill that included an unrelated provision written by Citigroup was a big legislative victory for the bank and its fellow Wall Street behemoths.

Yet it's also a victory that may soon come to haunt the largest institutions.

What they won was the repeal of a Dodd-Frank Act provision that requires them to push out a portion of their derivatives business into subsidiaries. Big banks fought against its inclusion in the 2010 financial reform law and have been steadily fighting to repeal it ever since. The spending bill is expected to pass the Senate in the coming days.

But in finally getting what they wanted, big banks also thrust themselves back into the limelight in the worst possible way, simultaneously reminding the public of their role in causing the financial crisis and in their continuing influence over the various levers of the U.S government. In one fell swoop, they undid whatever recovery to their battered reputation they'd made in the past four years and once again cast themselves as the prototypical supervillain in a comic book movie.

Observers said the fight was a public relations nightmare for Citigroup and the big banks.

"They've taken a lot of reputational hits now, a lot of people saying, 'You're trying to blackmail us and not fund our government until you get your way,'" said Sheila Bair, the former chairman of the Federal Deposit Insurance Corp., in an interview on CNBC before the House vote.

"It's terrible publicity and I just hate to see that because I think the industry needs to be rebuilding trust with the American people right now. You do stuff like this, it just adds to the cynicism about banks, especially big banks."

Many analysts agreed that repealing the swaps provision, which was Section 716 of Dodd-Frank, is likely to only help banks on the margins, since they are allowed to continue engaging in the activity through affiliates. But by fighting so hard, some saw signs of darker motivations.

"Wall Street's determined lobbying on Section 716 provides compelling evidence that Wall Street's business model depends on the ability of large financial conglomerates to keep exploiting the cheap funding provided by their 'too big to fail' subsidies," said Arthur Wilmarth, a professor of law at George Washington University. "Shame on Congress if it allows megabanks to continue to pursue the same business strategy that brought us the financial crisis."

Making matters potentially worse, news reports quickly surfaced that Jamie Dimon, JPMorgan Chase's CEO, also personally lobbied lawmakers on the bill. That helped rebut arguments by some that the provision wasn't a big deal to the big banks and that they weren't lobbying heavily for it.

It also allowed Democrats like Sen. Elizabeth Warren and Rep. Maxine Waters, who led the fight against the spending bill, to publicly call out both Citigroup and Dimon.

"I think after the president and Jamie Dimon started calling, some people gave in," said Waters, the top Democrat on the House Financial Services Committee, after the House vote, according to Politico

Earlier in the day, Warren made Citigroup her punchline in a tweet to her thousands of followers.

"Citigroup is holding government funding hostage to ram through its government bailout provision. Join me in opposing the #CitigroupShutdown," she wrote.

Ironically, Warren - big banks' long-time nemesis -- may be the biggest winner from the fracas. When the Massachusetts Democrat this week began lobbying Democrats to kill the spending bill because of the swaps provision, the conventional wisdom was that she had no chance of succeeding.

But with the help of Waters, Warren came close. They turned the House vote into a day-long drama and forced President Obama himself to whip for the spending bill despite opposing the repeal of the swaps provision.

Though Warren is unlikely to succeed, it was an impressive display of force, one that gives her even more influence in the Democratic party. In short, big banks inadvertently helped burnish Warren's reputation while at the same time damaging their own.

"On net, Wall St lost this week," said Brian Gardner, an analyst at Keefe, Bruyette & Woods, in a tweet.

Victoria Finkle contributed to this article