(Reuters) - An Oregon appeals court has wiped away a father’s criminal conviction for not changing his son’s diaper for at least 14 hours, overturning a jury’s verdict that the man was guilty of mistreatment.

The ruling by a three-judge panel on Wednesday found prosecutors in Lane County, south of Portland, failed to prove the dad, James Christopher Hickey, had failed to perform a diaper change for the boy on repeated occasions.

As a result, evidence of a “single untimely diaper change was not sufficient to allow a jury to find” Hickey had not protected the child from future “bodily harm,” the Oregon appeals court ruled in a 10-page opinion.

The 5-year-old boy, who has autism spectrum disorder and a condition that makes him incontinent, had to wear a diaper because he was not toilet trained, according to court records.

Hickey put his two children, ages 4 and 5, to bed at 8:30 p.m. on Aug. 17, 2012, in the town of Springfield. They climbed out of their bedroom window and were found the next morning by a passing motorists, who called sheriff’s deputies, according to court records.

The 5-year-old boy’s diaper was heavily soiled, prompting a sheriff’s deputy to change it as the boy, according to the deputy’s testimony, “writhed in discomfort.”

At that point, it had been at least 14 hours since Hickey put the child to bed, so the boy’s diaper had gone unchanged for at least that long and his skin was badly irritated, according to the appeals court opinion.

The appeals court, while overturning Hickey’s felony conviction of mistreatment, let stand his conviction on two counts of second-degree child neglect. Hickey served two years in prison in the case, including on the conviction that was overturned, but has since been released, said his public defender, Erica Herb.

“There was a lot of stuff that came out at trial that showed my client is not a bad person and is not a bad dad,” she told Reuters by telephone. She added that she did not know if Hickey would sue prosecutors for damages over his conviction.

Lane County prosecutors could not immediately be reached for comment.