Republicans largely supported Wednesday’s ruling by the U.S. Supreme Court that knocked down aggregate limits on campaign donations by individual donors, while Democrats criticized it.

House Speaker John Boehner told reporters that "freedom of speech is being upheld" by the decision, according to Politico.

"You all have the freedom to write what you want to write. Donors ought to have the freedom to give what they want to give," Boehner said.

Sen. Mitch McConnell of Kentucky, the Senate minority leader, hailed the decision as upholding the ideals of the U.S. Constitution.

"The Supreme Court has once again reminded Congress that Americans have a constitutional First Amendment right to speak and associate with political candidates and parties of their choice," McConnell said in a statement.

Republican National Committee Chairman Reince Priebus called the ruling "an important first step toward restoring the voice of candidates and party committees and a vindication for all those who support robust, transparent political discourse."

Both McConnell and the RNC were parties to the lawsuit, filed by Alabama businessman Shaun McCutcheon, who challenged the overall limits on what contributors may give in a two-year federal election cycle. The limits for the current election cycle included a separate $48,600 cap on contributions to all candidates.

McCutcheon gave $1,776 each to 15 candidates for Congress but wanted to give the same amount to 12 others. But doing so would have put him in violation of the cap.

The ruling, however, left in place limits on individual contributions to each candidate for president or Congress, now $2,600 for a primary election and another $2,600 for the general election.

"I am proud that the RNC led the way in bringing this case and pleased that the court agreed that limits on how many candidates or committees a person may support unconstitutionally burden core First Amendment political activities," Priebus said in a statement. "When free speech is allowed to flourish, our democracy is stronger."

Chris Chocola, president of the Club for Growth, said the ruling marked "a great day for the First Amendment, and a great day for political speech.

"We hope further efforts to increase the ability of citizens to participate in our democracy are also successful," he said in a statement.

Democrats strongly disagreed.

House Minority Leader Nancy Pelosi said the decision wrongly monetized the campaign process, and urged passage of a bill introduced in February that would boost the influence of small donors by offering them matching donations and tax breaks, The New York Times reports.

Pelosi also posted on Twitter:

W/ #McCutcheon, SCOTUS has chosen to pour even more money into our process & politics. We must restore fairness & pass the #ByThePeople Act.

"Make no mistake: This decision is a setback for our freedoms," said Sen. Jon Tester, a Montana Democrat, who has introduced a constitutional amendment that would overturn the 2010 Citizens United Supreme Court decision, which ruled that the government cannot restrict political donations from corporations in elections.

One notable Republican who agreed with Democrats was Sen. John McCain of Arizona, who co-sponsored the McCain-Feingold campaign finance reform bill that was passed in 2002, then largely overturned by the Citizens United ruling.

"While I have advocated for increasing the aggregate limits on individual contributions to candidates and party committees, I am concerned that today’s ruling may represent the latest step in an effort by a majority of the court to dismantle entirely the longstanding structure of campaign finance law erected to limit the undue influence of special interests on American politics," McCain said in a statement.

"I predict that as a result of recent court decisions, there will be scandals involving corrupt public officials and unlimited, anonymous campaign contributions that will force the system to be reformed once again," McCain said.