An appellate court on Thursday rejected a lower court ruling that companies could donate directly to political campaigns.

The U.S. Court of Appeals for the 4th Circuit in Richmond reversed a Virginia district court decision in the criminal case U.S. v. Danielczyk, which concerned contributions to Hillary Clinton’s 2008 presidential campaign.

U.S. District Judge James Cacheris ruled in 2011 that the Supreme Court’s landmark 2010 Citizens United v. Federal Election Commission decision gave corporations First Amendment rights to free political speech that were equal to those of individual people. In the Citizens United case, the court allowed corporations to spend as much as they wanted on elections as long as the money wasn’t given directly to candidates.

Activists working to defend campaign finance rules cheered the ruling.

“We are pleased the 4th Circuit corrected the gross judicial overreach by the lower court,” said Tara Malloy, a senior counsel at the Campaign Legal Center, which advocates for tighter regulation of political money. “The attempt to overturn the corporate contribution ban was an invitation to a return to the blatant political corruption and rampant scandals of the Gilded Age.”

The case concerned contributions gathered for Clinton’s campaign by Virginia businessman William Danielczyk and another executive of the Galen Capital Group. The two were charged with illegally reimbursing employees with corporate funds for their campaign contributions.

The appeals court decision reverses a motion to dismiss filed by defense attorneys and granted by Cacheris.

The courts have traditionally considered laws governing direct campaign spending with a higher level of scrutiny than rules on contributions to campaigns.