Two years into her prison sentence for sexually abusing a child, a Binghamton woman's conviction was tossed out Thursday by a New York State appeals court.

Samantha Werkheiser (she's also known as Samantha Stone) had been sentenced to 15 years behind bars in March 2017, after the 39-year-old former dance instructor's second trial ended with a Broome County Court judge's guilty verdict in the sexual abuse of a girl when she was 6 years old.

On Thursday, a mid-level appeals court dismissed the indictment against Werkheiser based on a technical error in how the charge she faced in the retrial — a felony count of first-degree course of sexual conduct against a child — was pursued in court.

When Werkheiser's first conviction was overturned, it was determined she couldn't be prosecuted for the original higher-level felony of predatory sexual assault against a child, because that charge was put on New York State's law books after her alleged criminal conduct.

Instead, she stood trial for a lesser included charge, course of sexual conduct against a child. On Thursday, the appeals court said the prosecution should have filed a reduced indictment against her after the charge was reduced, but never did.

"A valid and sufficient accusatory instrument is a non-waivable jurisdictional prerequisite to a criminal prosecution," Thusday's decision stated.

"Thus, notwithstanding the absence of any objection by defendant to the problem and a conviction on the reduced count that was supported by sufficient proof at trial, we are constrained to reverse the judgment of conviction and dismiss the original indictment as jurisdictionally defective."

Thursday's decision could be revisited in New York State's highest court, the Court of Appeals.

Tom Jackson, a Binghamton attorney who was the special prosecutor in Werkheiser's retrial, said, "the Court of Appeals has not been heard on this issue. I am reviewing the decision and the possibility of appealing the decision to the Court of Appeals."

MORE DETAIL: Read the appeals court decision below this article

Werkheiser had been convicted of sexually abusing the child — she's now 18 — between 2003 and November 2007 in a City of Binghamton residence.

The now-18-year-old woman is a close relative of the defendant, and although the accuser's name was disclosed in open court, the Press & Sun-Bulletin/pressconnects.com does not identify victims of sexual assault. The girl reported the allegations to Binghamton police in August 2011.

A key element of Jackson's case in the retrial was testimony from Werkheiser's accuser, who recounted abuses in graphic detail: sexual contact in a bathtub, as well as performing "inspections" on her body, among other acts.

More coverage:SEX ABUSE TRIAL: 'A child's innocence was lost,' prosecutor says

More coverage:SEX ABUSE TRIAL: Expert testifies on victims' struggles

Public defenders Mike Baker and Jonathan Rothermel countered that no physical evidence or witness testimony could corroborate the sex abuse allegations.

During the March 2017 sentencing hearing, Werkheiser adamantly maintained her innocence, saying she was the subject of a "witch hunt" and the accusations had been fabricated.

"As God as my witness, I have never sexually abused ... any child," Werkheiser proclaimed in court during her March 2017 sentencing.

"God is with me and he knows the truth," she continued. "He is my judge."

Another abuse case:Binghamton woman pleads guilty, faces 10 years in prison, for child sexual abuse

Werkheiser previously owned Creative Dance Elements, a dance studio on Water Street in Binghamton. In 2015, her predatory sexual assault conviction was overturned on appeal due to hearsay testimony during the first trial.

Follow Anthony Borrelli on Twitter @PSBABorrelli. Support our journalism and become a digital subscriber today. Click here for our special offers.