MINNEAPOLIS (AP) — A southern Minnesota judge dismissed a child pornography charge against a 14-year-old girl who sent an explicit image of herself to a boy over Snapchat, saying that using the state’s child pornography statute to prosecute the girl produces “an absurd” result.

The American Civil Liberties Union of Minnesota made a redacted version of the decision public Friday, saying the ruling by Rice County District Court Judge John Cajacob sends a message that prosecuting teens for sending explicit images of themselves isn’t the intent of Minnesota’s child pornography law.

READ MORE: Minneapolis Police Seek Person Of Interest In Wednesday's Homicide

According to court documents, the girl, who is not being identified because of her age, sent an image to a boy last fall and it was saved and shared with others. After a classmate reported it to police, prosecutors charged the girl with one count of felony dissemination of pornographic work.

In his Feb. 20 ruling, Cajacob wrote that Minnesota’s child pornography statute is designed to protect children from victimization, and that using it to punish the girl for sending explicit images of herself “produces an absurd, unreasonable, and unjust result that utterly confounds the stated purpose of the statute.”

Defense attorney John Hamer said he was thrilled the judge ended “the unabashed state-sponsored victim-shaming the prosecution engaged in.” A message left with the Rice County attorney wasn’t immediately returned Friday.

READ MORE: Vanin Dell McKinnon Faces Third Child Sexual Assault Case

Cajacob also wrote that the severe penalties if convicted — including a mandatory 10 years on the sex offender registry — suggest the statute targets adults who abuse children, not teens who sext each other. He said it’s absurd when a teen who sends a picture to another teen is punished as harshly as an adult who films himself performing sex acts with a minor.

“The punishment is vastly disproportionate to this girl’s ‘crime,'” Cajacob wrote. “This Court cannot see how subjecting (the girl) to registering as a sexual offender would protect her or teach her anything but that the justice system is cruel and unjust. The idea that heavy-handed enforcement of pornography laws is going to help these misguided, struggling teens is itself absurd.”

He wrote that there are less restrictive ways to deal with the issue of teen sexting. For example, he said, Illinois courts may find a minor involved in sexting to be in need of supervision, and may order counseling or community service. Vermont has a specific statute for sexting that calls for a juvenile diversion program, expunges the charge once the child is 18, and specifically excludes registration as a sex offender.

MORE NEWS: Families Upset Over Teacher Realignment At Winona State University's Children's Center

(© Copyright 2018 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)