It was an incident that began innocently enough, but nearly ruined the life and three-decade career of a veteran high school teacher and administrator.

Rumors had been flying at Freedom High School in South Riding, Virginia that students were distributing nude pictures of each other on their cell phones. It's a phenomenon, known as "sexting," that's become increasingly worrisome to educators across the country, and Ting-Yi Oei, a 60-year-old assistant principal at the school, was tasked with checking it out.

Ting-Yi Oei and his wife, Diane Curling

Courtesy Ting-Yi Oei The investigation was inconclusive, but led to a stunning aftermath: Oei himself was charged with possession of child pornography and related crimes – charges that threatened to brand him a sex offender and land him in prison for up to seven years. Transferred from his school and isolated from colleagues, Oei spent $150,000 and a year of his life defending himself in a Kafkaesque legal nightmare triggered by a determined county prosecutor and nurtured by a growing hysteria over technology-enabled child porn at America's schools.

"The heaviest burden is the [label] of 'child pornographer'," Oei says. "It just hangs so heavy around me. How you ever recover from that I don't know. "

On Tuesday, Oei's legal nightmare ended when a Virginia judge threw out the case before it got to trial. But as the educator begins piecing his life back together, similar tragedies are unfolding across the country. Reacting to the phenomenon of underage "sexting," prosecutors in at least a dozen states have resorted to arresting or charging kids for possession of child pornography. In a recent case in Pennsylvania, six teens aged 14 to 17 were charged with creating, distributing and possessing child porn. And this week a judge in a separate case in Pennsylvania temporarily barred a prosecutor from charging three teens for taking photos of themselves in their bras and a towel.

Even in this environment of prosecutorial excess, Oei's case stands out as likely the first to entangle an adult who came in possession of an image that even police admit wasn't pornographic, and who did so simply in the course of doing his job.

"These charges are so toxic and incendiary," says Diane Curling, a former teacher and Oei's wife of 35 years. "Children need to be made aware of the dangers of sexting, but to intimidate public education officials and try to make it a felony to even touch something like this is terrifying. . . . If we are not careful, we will find ourselves with a new McCarthy era. "

Oei's problems began in March of last year, when his investigation of sexting rumors at Freedom High led him to a 16-year-old boy. Oei and the school's safety and security specialist met with the student to ask if he knew anything about the photos.

"He says, 'Oh yeah, I've got one on my cell phone,'" Oei recalls.

The image depicted only the torso of a girl – later determined to be a 17-year old student – wearing only underpants, her arms mostly covering her breasts. The boy claimed he didn't know who sent him the photo or who the girl was.

Oei says he showed the image to his boss, Principal Christine Forester, who told him to preserve a copy on his office computer for the investigation. A computer neophyte, Oei didn't know how to transfer the image from the boy's cell phone, so the teen sent the picture to Oei's phone, and told him how to forward it to his work e-mail address. When the process was complete, Oei instructed the student to delete the image from his phone.

Oei and the school security specialist interviewed more students, but were unable to find additional pictures or identify the girl in the photo. Oei concluded she probably wasn't a student at the school. Relieved, he says he reported his findings to the principal, thinking the matter was done.

He couldn't have been more wrong.

Two weeks later, the boy caught with the photo was in trouble again – he'd pulled down the pants of a girl in class. The school suspended the student for 10 days. But when the boy's mother learned from Oei about the earlier photo incident, she was outraged that Oei hadn't reported the picture to her. She called his house at 7:00 a.m., screaming at him that the suspension had to be revoked.

When Oei refused, the woman went to the police about the photo. Sheriff's investigators came to the school, ostensibly to investigate the sexting issue. They helped the technologically-challenged Oei recover the photo from his cell phone and later determined the girl in the photo was a student at the school.

A month later, the first charges were filed against Oei: failure to report suspicion of child abuse, a misdemeanor. The charge alleged that Oei had a legal duty to report the girl's photo to her parents, and to state agencies or law enforcement.

"First of all, nobody thought this was reportable," Oei says. "Who would have thought this was suspected child abuse?"

Oei also hadn't known the girl's identity and therefore wasn't able to notify her parents.

The prosecution looked like an error right out of the gate. The photo didn't show sexual activity or genitalia, and even the sheriff's office conceded it was "inappropriate" but not "criminal" – making it unclear what the "child abuse" was supposed to be. In any event, as a matter of law, Oei was only required to report suspected abuse to his principal, which he'd done. It was then Forester's job to report it to authorities if needed. Oei said Forester didn't step in to defend him to authorities. (Forester didn't return phone calls for this story)

But rather than drop the misapplied charge, Loudoun County prosecutor James Plowman upped the ante.

Plowman had been swept into office as Loudoun's Commonwealth's Attorney in 2004, following a lively campaign in which he accused the incumbent prosecutor of turning Loudoun into "one of the softest counties in Virginia on crime." In 2007, his tough-as-nails image won him re-election with 80 percent of the vote.

Loudoun Commonwealth's Attorney Jim Plowman

Courtesy jimplowman.orgThe prosecutor gave Oei an ultimatum: resign, or see his misdemeanor charge bumped up to a felony. "We just feel very strongly that this is not someone who should be in the Loudoun County school system," Plowman's assistant explained to reporters. Oei refused, and on August 11, a grand jury indicted him for possession of child porn, a crime that carries a possible sentence of five years. The misdemeanor charge was dropped.

And so it was that Oei, a Quaker of Chinese and Dutch descent, a former Fullbright exchange teacher, Peace Corps volunteer and 30-year veteran educator, was arrested nine days later at school.

Oei's world changed overnight. He was released on his own recognizance, and the district reassigned him to a job at the county testing center, away from students. A parent that Oei encountered one day at a restaurant avoided eye contact with him, and his colleagues at the school were advised not to contact him. The day after his arrest, Oei was on a treadmill at the gym when his face suddenly appeared on two large TV screens broadcasting the news.

"There I am, big as life," he recalls ruefully.

An exerciser on the treadmill next to him glanced his way.

He lost 15 pounds, and couldn't sleep. Oei resigned from his position as president of the Coalition of Asian Pacific Americans of Virginia so the organization wouldn't be tainted by his legal troubles, and took out a second mortgage on his house to cover legal costs. His wife, already struggling with a serious physical health issue, became paranoid.

"We had to tell all our friends when they sent us e-mail that police could seize computers at any time so anything they wrote us could be accessed," Curling says. "Any phone call they made to us could be recorded."

Warned that their house could be searched, Curling went through the family photos to see if there were any baby pictures of their now-grown children in a state of undress. "Heaven forbid that a parent might think it was cute for a baby to play in a bubble bath and there might be an inappropriate part showing," she says. "Luckily all of our rubber-ducky baby photos had the children covered in bath bubbles or something."

After planting her garden with flowers, she saw people looking up at the house and pointing. "I was wondering if they were neighbors saying, 'Oh, that's where the pervert lives,' or complimenting me on my choice of Chrysanthemum colors," she says.

Four months later, Plowman charged Oei with two more misdemeanor counts for contributing to the delinquency of a minor, claiming Oei broke the law when he had the 16-year-old boy send the photo to his cell phone and advise him on how to then forward it to his desktop computer. Each count added another year to his possible prison term. "The December charges really felt like piling on," Oei says.

When things looked darkest, the family found an unexpected wellspring of support.

The Loudoun Education Association and Virginia Education Association came to Oei's aid with loans and grants that covered about 30 percent of his legal costs. Then dozens of current and long-lost friends from the family's Quaker community and elsewhere – including former students and friends they'd been out of touch with for decades – started appearing to offer support. Oei went to court for a pre-trial hearing, and found 38 supporters crammed into the gallery pews.

Then last month, Oei's defense attorney, Steven Stone, filed a motion to dismiss the charges on the grounds that the photo didn't constitute child pornography. In a ruling on Tuesday, Loudoun Circuit Court Judge Thomas Horne agreed. Citing a long history of state appeals court decisions, Horne noted that nudity alone is not enough to qualify an image as child pornography. The image must be "sexually explicit" and "lewd."

"As a matter of law, the photograph does not meet the requirements established by our appellate courts and the felony charge will be dismissed," the judge wrote. "[T]he two misdemeanor counts will be dismissed as well."

Despite the ruling, Plowman, the prosecutor, stands by his initial assessment of the photo.

"The issue of whether it meets the definition under the statute ... goes to whether it is lewd," he says. "This one I felt was [lewd] because of the focus of the picture, which was the private areas ... and the provocative pose she was in. The judge felt it didn't meet the precedent case law for child pornography, but it was apparently provocative enough of a photograph that he saw fit that it should be sealed."

Plowman insists he never intended to seek prison time for Oei. He would have been satisfied with a fine, probation and Oei's resignation. The case would never have gone this far, he says, if Oei had resigned when asked.

"I thought that was a just and appropriate sanction for his behavior," he says. "But he was unwilling to be responsible for any kind of accountability for what he did."

Now Oei is left with the aftermath, including deep debt and a tarnished reputation. Asked about the possibility of suing the prosecutor's office to recover the cost of his defense, Oei's lawyer says it would be difficult. "Prosecutors in Virginia have a pretty solid grant of immunity, so he's going to be up against a lot if we get to that point," Stone says.

Oei says he's grateful that the school district never took away his pay throughout the ordeal, but he isn't sure he wants to go back to the school after being abandoned by its principal. Yet he knows that finding another job wouldn't be easy.

"If someone were to Google me, why would you want to touch someone who had [this trouble], even if I had the charge dismissed?" he says. "I don't think you'd necessarily want that baggage."

[A previous version of this story had authorities asserting that Oei should have notified the 16-year-old boy's parents about the photo the boy had on his phone. The piece has been corrected to indicate that authorities asserted that he should have notified the parents of the girl in the photo, whom Oei was unable to identify.]

See also: