More than 20,000 Breathalyzer tests might be tossed out after it was discovered the machines were apparently not properly calibrated.

New Jersey State Police Sgt. Marc Dennis allegedly mishandled the devices that determine a driver's blood alcohol content (BAC), the state's Supreme Court ruled Tuesday, according to NJ Advance Media.

VIDEO SHOWS STATE TROOPERS PULLING UNCONSCIOUS DRIVER FROM BURNING CAR

The justices unanimously found that criminal charges pending against Dennis — who oversaw the calibration of the devices as a coordinator with the State Police Alcohol Drug Testing Unit — made breath-testing device test results from five counties inadmissible as evidence.

The sergeant pleaded not guilty in January 2017 to official misconduct and records tampering charges after he was accused in 2016 of lying about the Breathalyzer machines on official documents.

Authorities have alleged he skipped a required step in the calibration process.

State authorities, however, have maintained that the step Dennis allegedly skipped was one of several redundancies and fail-safes meant to ensure the readings are accurate. They claim that omitting that one step didn't invalidate the results, noting New Jersey is the only state that requires the step.

Dennis has denied any wrongdoing and has pleaded not guilty to records tampering and other charges.

NEW JERSEY FAMILY'S BRUTAL SLAYING REVISITED BY POLICE 40 YEARS LATER WITH NEW BALLISTIC, DNA TESTS

As many as 20,667 DWI convictions could now be challenged, according to state authorities and the lawyer for the now-dead plaintiff who brought the case that the court ruled upon.

The accusations against Dennis called into question any test result involving a machine he handled, including devices used by local police in Middlesex, Monmouth, Ocean, Somerset, and Union counties between 2008 and 2016.

As part of their decision, the justices ordered state authorities to notify anyone whose case involved results from machines Dennis calibrated. Those authorities must tell them that their Breathalyzer results were not scientifically sound, so they can decide whether they want to go to court and seek to have their convictions vacated.

The Associated Press contributed to this report.