The Supreme Court on Thursday opened wide new avenues for big-moneyed interests to pour money into politics in a decision that could have a major influence on the 2010 midterm elections and President Barack Obama’s 2012 reelection campaign.

The long-awaited 5-4 decision overruled all or parts of two prior rulings by the court that allowed governments to restrict corporations and unions from spending their general funds on ads expressly urging a candidate’s election or defeat. But the decision upheld disclosure requirements for groups like the one that brought the case.

The decision, handed down in a special session of the court, is generally expected to boost Republicans more than Democrats, because corporations and corporate-backed outside groups tend to align with conservatives and also often have access to more money than unions or liberal outside groups.

“No sufficient governmental interest justifies limits on the political speech of nonprofit or for-profit corporation,” Justice Anthony Kennedy wrote for the majority.

In a stinging dissent, Justice John Paul Stevens wrote that the ruling “threatens to undermine the integrity of elected institutions across the nation. The path it has taken to reach its outcome will, I fear, do damage to this institution.”

President Obama led a chorus of Democrats and public interest groups attacking the decision, saying in a statement that the court “has given a green light to a new stampede of special interest money in our politics,” and vowing that he will work with congressional leaders “to develop a forceful response.”

“It is a major victory for big oil, Wall Street banks, health insurance companies and the other powerful interests that marshal their power every day in Washington to drown out the voices of everyday Americans,” the president said. “This ruling gives the special interests and their lobbyists even more power in Washington—while undermining the influence of average Americans who make small contributions to support their preferred candidates."

The case stems from a lawsuit against the Federal Election Commission brought by an obscure conservative group called Citizens United. It alleged that its free speech rights were violated when the FEC moved to block it from using corporate cash to promote and air "Hillary: The Movie," a feature-length movie harshly critical of then-Sen. Hillary Clinton – the current secretary of state – during her 2008 campaign for the Democratic presidential nomination.

The FEC asserted that the movie expressly opposed Clinton’s election and therefore was subject to campaign laws that bar the use of corporate cash to air election ads, and require donor disclosure. Citizens United disagreed and sued.

Lower courts sided with the FEC, and the Supreme Court first heard the case in March. But in June, instead of coming back with a ruling, Chief Justice John Roberts asked the parties to return for a rare re-argument of the case — with a much broader focus.

Instead of merely arguing whether federal election laws should have applied to “Hillary: The Movie,” Roberts asked the parties to argue whether the court should reverse rulings in two prior cases upholding the government’s ability to limit corporate and union election spending.

The court divided along ideological lines on the decision with Justice Anthony Kennedy casting the deciding vote and writing the majority opinion. He was joined by Roberts and fellow conservative justices Samuel Alito and Antonin Scalia.

Another conservative justice, Clarence Thomas, filed a separate opinion that mostly concurred with the majority, but made the case for going even further by striking down disclosure requirements.

The dissent was written by Justice John Paul Stevens, who was joined by liberal justices Ruth Bader Ginsburg, Stephen Breyer and Sonia Sotomayor.

The decision reverses a 1990 ruling by the court that allowed the government to bar corporations and unions from spending general treasury funds on ads expressly urging a candidate’s election or defeat. And it overruled part of a 2003 decision that upheld restrictions on independent corporate expenditures enacted the preceding year in the seminal campaign finance overhaul act known as McCain-Feingold.

The authors of the law, Sens. John McCain (R-Ariz.) and Russ Feingold (D-Wis.), expressed disappointment in the ruling, with Feingold calling it “a terrible mistake.”

The decision is expected to boost Republicans and offset the campaign cash advantage enjoyed last year by Obama’s fundraising juggernaut, as well as the financial edge Democrats had enjoy heading into November.

Though it’s unclear which groups will take advantage of the spending flexibility created by the decision, many corporations and corporate-backed groups have signaled their opposition to initiatives pushed by Obama and the Democratic congress.

For instance, the U.S. Chamber of Commerce, which spent $36 million on ads and get-out-the-vote activities in 2008, pledged this week to organize the largest, most aggressive election campaign in its history targeting congressional Democrats who support Obama administration proposals to overhaul health insurance and the financial system and limit carbon emissions.

The Chamber, as well as the GOP-aligned National Rifle Association, filed briefs in the case supporting the conservative non-profit group challenging the rules, though so did the American Federation of Labor and Congress of Industrial Organizations, or AFL-CIO.

The ruling, which had been expected months ago, will force campaign operatives, lawmakers, campaign finance advocacy groups and regulators to quickly assess the new campaign spending landscape heading into the midterms. They don’t have much time to adapt — or try to tighten — the new loopholes, because some states have congressional primaries as early as February and March.

Lawyers for all manner of corporations, unions, outside political groups and parties immediately began poring over the decision to determine how their clients could best take advantage of the increased flexibility it afforded them.

Additionally, the FEC will have to decide whether it will be necessary to write new rules or guidance explaining what regulated groups need to do to remain compliant under the new ground rules. After the last major Supreme Court campaign finance decision, a 2007 ruling that expanded the types of ads that corporations and unions could fund in the run-up to Election Day, it took the FEC about five months to write new rules.

Advocacy groups that support stricter campaign finance regulations cited the decision as an added reason to push for new reforms, including a bill that would provide taxpayer money for congressional campaigns.

“We need to change the way America pays for elections,” said Bob Edgar, president of the nonprofit government watchdog group Common Cause. His group supports a public funding bill introduced by Sen. Dick Durbin (D-Ill.) and Rep. John Larson (D-Conn.). “Congress must free itself from Wall Street's grip so Main Street can finally get a fair shake," he said.

Rep. Chris Van Hollen (D-Md.) and Sen. Chuck Schumer (D-N.Y.), said Democrats also would work to push through legislation to try and reverse the decision in time for the 2010 midterm elections, though they said it wasn’t clear what shape the legislation would take.

One option could be requiring shareholders to vote before a corporation could give money directly to a candidate, said Schumer.

Van Hollen called the decision “radical” and said it proved the conservative majority did not respect precedent, contrary to assertions made in recent years by Roberts and Alito during their confirmation hearings.

Meanwhile, the decision brought praise from many Republicans, as well groups that view campaign finance rules as infringements on free speech.

Rep. Mike Pence (R-Ind.) said the ruling “takes us one step closer to the Founding Fathers’ vision of free speech, a vision that is cherished by all Americans and one Congress has a responsibility to protect.”

“This is a great day for the American people and free speech,” said Cleta Mitchell, a top Republican election lawyer. She said that through the decision the court “has ripped the duct tape off the mouths of the American people.”