A court decision that critics said effectively legalized bribes for political candidates has been overturned.

In a ruling published Monday morning, a state court of appeals clarified that a law outlawing bribery did not exclude candidates who did not yet hold a public office.

The appeal stemmed from now-dismissed charges against former Democratic Assemblyman Jason O’Donnell.

O'Donnell was one of five public officials arrested in a 2019 anti-corruption sting. The year prior, O'Donnell had run for mayor of Bayonne.

The state Attorney General's Office accused O'Donnell of taking a bag filled with $10,000 cash while on the campaign trail. Prosecutors said he took the bag from someone hoping to get a position within his administration.

But O'Donnell did not win the election and never took office.

Judge Mitzy Galis-Menendez's decision in June 2021 ruled that the state's bribery law did not apply to some candidates. It prompted an outcry from lawmakers and the state Attorney General's Office.

"We strongly disagree with the decision, which, if upheld, effectively legalizes bribing candidates for public office,” a spokesman for the Office of the Attorney General said at the time.

The law itself, N.J.S.A 2C:27-2, specifically mentions public servants, party officials, and voters. Galis-Menendez found that since it technically did not include candidates for office, O'Donnell could not face charges.

But Monday's strongly-worded decision rejects this line of thinking. The judges called it a "nonsensical conclusion" that lawmakers intended to give some candidates the ability to take bribes with no consequences.

"There is nothing about this broad language," Monday's decision said, "to suggest that somewhere in the provisions interstices lurked a legislative intent to give candidates for office carte blanche to accept bribes without consequence up until the moment they take office or if they never take office."

Acting Attorney General Matthew Platkin applauded the decision in a written statement sent to New Jersey 101.5.

"We’re grateful that the appellate court today confirmed candidates for office may not take bribes in exchange for promising to perform official duties if they are elected," Platkin said. "That commonsense prohibition is embodied in the plain language of our law, and I remain committed to pursuing these cases whenever they arise."

Monday's decision only greenlights prosecutors to again pursue charges against the former assemblyman. It did not make any reference to guilt.

O'Donnell's attorney Leo Hurley Jr. did not respond to a request for comment Monday.

State lawmakers unanimously passed a bill last month to close the potential loophole and prevent future debate. Governor Phil Murphy has yet to sign the bill into law.

New Jersey's new congressional districts for the 2020s

A district-by-district look at New Jersey's congressional map following the redistricting done after the 2020 Census.

2022 Seaside Heights Polar Bear Plunge photos

More than 6,000 people took the plunge into the Atlantic Ocean on Feb. 26, 2022 to raise more than $2 million for the Special Olympics New Jersey.

Check out the most expensive home for sale in Somerset County