Prosecutors failed to show a former state child case investigator from Pekin solicited sex from a 14-year-old girl and committed related crimes, a Tazewell County judge ruled Thursday.

Circuit Judge Michael Risinger ended a bench trial by granting a defense motion to acquit Melvin Devall, 58, of Pekin, after the state rested its case on two felony counts of official misconduct and misdemeanor counts of obstructing a police officer and solicitation of a sex act.

“This is the greatest surprise to myself that I grant this motion,” Risinger said.

Devall was placed on leave and later resigned from the Illinois Department of Children and Family Services after he was charged with arranging to meet the girl in Coal Miners Park in Pekin in August 2016. Two young men and a youth waiting for him in the park’s woods robbed and beat him.

Devall first told police that he was attacked after the girl shouted to him in his parked car, where he was doing DCFS paper work, that she needed help and he followed her into the woods. Within days, however, police arrested the defendants who revealed their robbery plot.

Risinger found those arrests effectively negated the obstruction case against Devall.

He also agreed with defense attorney Derek Asbury that neither the girl nor Jordan Baugh, then 18, who posed as the girl in a phone call to arrange her meeting with Devall, personally asked Devall for money for sex.

Baugh testified that he owed money for drugs to Peoria “gangsters,” who suggested the robbery plot to raise it. “You gotta do what you gotta do,” he said.

The drug dealers placed a “prostitution ad” in an online advertising website, Baugh said. Devall answered with a call to Baugh, posing as the girl, in which he said he would pay $140 for two hours with a “slave girl,” Baugh said.

Devall’s DCFS superior told police he was on duty and reportedly working on a case when the event took place. Prosecutors argued that amounted to official misconduct.

Risinger disagreed, finding under previous case rulings that, “Nothing showed he used his position to benefit from what (he thought) was going to happen.”

Baugh and the other young men, including one who drove the robbers from the park, were given probation terms for the robbery. Baugh’s probation was recently revoked and replaced with a five-year prison term. The girl and youth were adjudicated in juvenile court.