President Obama on Tuesday weighed in on a Supreme Court challenge to campaign finance laws and argued against lifting limits on donors, saying it would have a damaging effect on the electoral process.

"The latest case would go even further than Citizens United. It would essentially say 'anything goes,'" said Obama at a White House press conference.

The president said that "ordinary Americans" would be further "shut out" of the political process. But he acknowledged that "there’s nobody who operates in politics who has perfectly clean hands on this issue."

In his two presidential campaigns, Obama opted out of federal matching funds and raised $1.1 billion for the 2012 cycle.

"Democrats aren't entirely innocent of this in the past," said Obama. "I had to raise a lot of money."

Obama's comments came after the high court listened to oral arguments in McCutcheon v. Federal Election Commission, which challenges federal laws that limit how much an individual can donate to certain political groups and candidates each election cycle.

The lawsuit is the most important campaign finance case since the court's ruling in Citizens United in 2010, which struck down independent spending by corporations and labor unions.

Obama has previously criticized the ruling in Citizens United, saying it opened the door for deep-pocketed special interests to distort the electoral process.

Supporters of the ruling say it protects First Amendment rights by removing restrictions on political speech.

Obama said that if the court struck down the laws being challenged in McCutcheon, the nation would "basically have millionaires and billionaires bankrolling whomever they want, however they want."

The president added that he believed Citizens United had contributed to the gridlock and rancor in Washington amid a budget fight that led to the first government shutdown in 17 years.

Obama said lifting campaign finance laws had allowed “ideological extremes” to “skew our politics.”