Obama called it a big victory for big oil, Wall Street banks, health insurance companies and other powerful interests.
The ruling by the conservative majority transformed the political landscape and the rules on how money can be spent in future presidential and congressional elections, which have already broken new spending records with each political cycle.
The justices on Thursday overturned supreme court precedents from 2003 and 1990 that upheld federal and state limits on independent expenditures by corporate treasuries to support or oppose candidates.
|Al Jazeera's John Terrett explains how the court order will affect congressional elections
Writing for the majority, Justice Anthony Kennedy said the limits violated constitutional free-speech rights.
"We find no basis for the proposition that, in the context of political speech, the government may impose restrictions on certain disfavoured speakers," he wrote.
The court's conservative majority, with the addition of Chief Justice John Roberts and Justice Samuel Alito, both Bush appointees, previously voted to limit or strike down parts of the law designed to regulate the role of money in politics and prevent corruption.
The court's four liberals, including its newest member, Justice Sonia Sotomayor, who was appointed by Obama, dissented.
In his sharply worded dissent, Justice John Paul Stevens said: "The court's ruling threatens to undermine the integrity of elected institutions across the nation."
The case began when a conservative group, Citizens United, made a 90-minute film called Hillary: The Movie that was very critical of Hillary Clinton, now-secretary of state, as she sought the Democratic presidential nomination.
Citizens United wanted to air advertisements for the film and distribute it through video-on-demand services on local cable systems during the 2008 Democratic primary campaign.
But federal courts said the film looked and sounded like a long campaign advertisement, and therefore should be regulated like one.
Hillary: The Movie was advertised on the internet, sold on DVD and shown in a few theatres.
Campaign regulations do not apply to DVDs, theatres or the internet.
The court first heard arguments in March, then asked for another round of arguments about whether corporations and unions should be treated differently from individuals when it comes to campaign spending.
After a special argument session in September, the conservative justices gave every indication that they were going to take the steps they did on Thursday.