More than 20,000 people accused of drunken driving in New Jersey could have their cases tossed based on a Tuesday ruling of the state's Supreme Court.

In a unanimous decision, the high court found criminal charges against a State Police sergeant who was in charge of calibrating breath-testing devices made the test results from five counties inadmissible as evidence.

The court vacated the conviction of a woman who pleaded guilty to drunken driving based on a result from one of those machines - and then died while waiting for the legal fight to finish.

It also ordered state authorities to notify anyone whose case involved results from machines Sgt. Marc Dennis handled that those results weren't scientifically sound.

The decision opens the floodgates for thousands of people to challenge DWI convictions that occurred over nearly a decade.

In 2016, Dennis was accused of lying on official documents about performing a legally required temperature check while calibrating just three machines, known as Alcotest devices, which gauge the blood-alcohol level of accused drunken drivers.

The criminal case against Dennis is still pending. Reached Tuesday, his attorney said the sergeant maintains his innocence.

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

The disclosure prompted a New Jersey woman, Eileen Cassidy, to seek to withdraw a guilty plea she entered in Spring Lake Municipal Court based on the results of a breath test. Cassidy died of a terminal illness in March, but the justices still ruled on the case because of the "significant public importance" of the issue.

State authorities maintained that the temperature check Dennis was accused of skipping was one of several "redundancies and fail-safes" to ensure the readings are accurate and that omitting that one step did not invalidate the results. New Jersey is the only state that requires the step, they argued.

But the Supreme Court, siding with Judge Joseph Lisa, who was appointed as a "special master" to handle the issue, found the omission of the step raised "substantial doubts" about the reliability of the machines.

County prosecutors began notifying defendants in 2016 that their cases could be thrown out, but those cases had been on hold pending the Supreme Court's ruling. On Tuesday, the court ordered state authorities to "notify all affected defendants of our decision ... so that they may take appropriate action."

Attorney General Gurbir Grewal said at an unrelated event Tuesday that his office was reviewing the decision.

"We're still coming up with guidance for our county prosecutors and municipal prosecutors who handle many of these cases," he said.

It's unclear how many cases will ultimately be tossed. Breath tests are an important part of DWI cases, but a person can still be convicted of drunken driving without one.

Michael Hobbie, the Eatontown attorney who represented Cassidy, said the pool of 20,667 includes an unknown number of people who may have been found not guilty at trial, or were convicted on the observation of the officers at the scene rather than a breathalyzer result.

What's more, Hobbie said, defendants have to come forward to challenge their conviction, and because the pool of cases goes back years, many of them may have already served their license suspensions and other punishments in the time that has passed.

"Are you going to want to go out and hire a lawyer and go prosecute this case again?" he said.

S.P. Sullivan may be reached at ssullivan@njadvancemedia.com. Follow him on Twitter. Find NJ.com on Facebook.