A 61-year-old man who secretly took photographs up a 13-year-old girl's skirt did nothing illegal, an Oregon judge ruled Thursday. While judge Eric Butterfield called the act  “lewd” and “appalling,” he said there was no legal wrongdoing.

Portland resident Patrick Buono was acquitted of all charges relating to the January 2014 incident in which he used his cell phone to take photos under the girl's skirt in a Target store in Beaverton, Oregon. An eyewitness noticed the incident, although the girl did not. According to the Oregonian, Buono did not dispute the facts, but his defense team said he did not break any laws.

Buono was charged with two counts of invasion of privacy and two counts of second-degree encouraging child abuse, which is related to child pornography. But his defense lawyer argued there was no expectation of privacy at the Target, there was no nudity involved and that the girl was not engaging in sexual behavior, provisions that are required to convict on those charges.

Butterfield determined the act was not illegal, but didn’t condone Buono’s behavior. “I’m extremely frustrated with this decision,” the judge said, according to the Oregonian. “It’s upsetting to say the least.”

Other state courts have made similar determinations over so-called upskirt photos in recent months. In September, Texas’ Court of Criminal Appeals threw out part of a law that banned such photos, saying it was a violation of federal free-speech rights. A judge in Washington, D.C., also threw out charges against a man accused of taking upskirt photos of women near the Lincoln Memorial, saying the women had no reasonable expectations of privacy. Last March, a Massachusetts court also ruled that upskirt photos were not illegal because the women targeted were clothed. Shortly afterward, the state legislature passed a ban on the practice.