It would be difficult to cite a more shameful episode in the history of America's criminal justice system than the pedophilia panic of the 1980s and '90s. Police, prosecutors, and social workers all over the country were overcome by hysteria about the supposed proliferation of ritual sex abuse, a fear fed by a new movement of quack, Christian fundamentalist psychologists. Although dozens of convictions have been overturned, we are nowhere near uncovering all the damage wrought by this panic. The case of Nancy Smith and Joseph Allen shows how the same criminal justice system that rushed to convict innocent people can take decades to recognize and correct its mistakes.

Smith, a bus driver, and Allen, an unemployed laborer, were imprisoned from 1994 to 2009 after they were convicted of bizarre and grotesque crimes against children at a Head Start school in Lorain, Ohio, where Smith worked. Prosecutors alleged that Smith, a single mother of four, routinely kept several children on the bus after dropping the rest off at school. They said she would take the remaining children to Allen's home, or possibly somewhere else, where the two adults would molest the children, rape them, put them through all sorts of outlandish and perverted rituals, then clean them up, dress them, and put them back on the bus in time for Smith's evening route. (She had a second job delivering Meals on Wheels in the afternoon.) Smith was sentenced to 30 to 90 years in prison, while Allen received five consecutive life sentences.

In 2009 Smith's and Allen's attorneys challenged their sentences on technical grounds related to the wording of the sentencing orders. Most observers expected Lorain County Common Pleas Court Judge James Burge (who was not the judge who had presided over the trial) to correct the error and resentence Smith and Allen to the same prison terms. But Burge reviewed Smith and Allen's case files while preparing for the hearing and was appalled by the lack of evidence against them. Instead of resentencing Smith and Allen, Burge stunned the courtroom by acquitting them and ordering their release.

Prosecutors challenged Burge's decision, and last month the Ohio Supreme Court ordered Smith and Allen back to prison after two years of freedom, finding that Burge had exceeded his authority. The court ruled that Burge should have considered only the sentencing error, not Smith and Allen's guilt or innocence. Unlike Burge, the court did not review the evidence against Smith and Allen; its ruling was strictly about procedure. Smith and Allen have been permitted to remain free while their attorneys ask the court to reconsider its decision.

I don't know Ohio criminal procedure, so I'm not qualified to comment on the quality of the court's legal analysis. Commenting on the case at the Volokh Conspiracy blog, UCLA law professor Eugene Volokh writes that reversing a judge-ordered acquittal does not violate the U.S. Constitution's Double Jeopardy Clause. But like a recent decision by the U.S. Court of Appeals for the 9th Circuit that overturned a lower court's finding of actual innocence in a sex abuse case because the defendant's attorney had missed a deadline to file the claim, the Ohio Supreme Court's ruling starkly illustrates the difference between law and justice.

It is impossible to adequately convey the outrage perpetrated on Smith and Allen in a single column. (This long but compelling Crime Magazine article tells the story in great detail.) But here are the highlights.

There isn't a single piece of physical evidence against Smith or Allen. There were no hairs or bodily fluids from either of them on the children who allegedly were abused, or vice versa. There were no medical examinations of the children that found evidence of physical abuse. Prosecutors could provide jurors with no specific dates when the abuse allegedly occurred (denying Smith and Allen the chance to provide alibis), nor could they specify where it occurred. At one point in the trial the prosecutors alleged that Smith drove the children to Allen's home, and they attempted to show that one child could identify items seized from Allen's home after he was arrested. But when defense attorneys poked holes in that story—noting, for example, that prosecutors could find no one who had seen Smith's bus parked at Allen's home—the prosecutors changed their story, saying the abuse must have taken place somewhere else.

Smith and Allen claimed then, and still claim, that they had never met before they were arrested. The prosecution presented two witnesses in an attempt to link the defendants to each other. One was a child who claimed to have seen them together at a bus stop. But that child was at one point also supposed to testify as a victim. The problem for prosecutors: He alleged that Smith and another woman, not Allen, had abused him. So they didn't ask him about the alleged abuse. The other testimony linking Smith and Allen came from a Head Start employee who claimed to have seen Allen arguing with Smith after trying to board her bus. But a Head Start parent remembered that incident and said it was he, not Allen, who got into the argument with Smith.

The case got started when the mother of a Head Start student claimed her daughter told her that Smith and someone named Joseph had sexually abused her. Detective Tom Cantu of the Lorrain Police Department's Youth and Gang Unit interviewed the child, her mother, Smith, and Head Start employees. He found no evidence to support the allegations. But the mother persisted. She went to the press and started talking about the allegations to other Head Start parents. Rumors circulated. Soon the mayor and the Lorain County Prosecutor's Office got involved. The mother initially said Joseph was a white man (Joseph Allen is black) who owned a local gay bar (homophobia often factored into false ritual sex abuse allegations). When that suspect was cleared, the search for the "real" Joseph was on.

Six months after the initial allegations, Joseph Allen walked into a police station to report that his car had been stolen. An officer who had worked on the sex abuse investigation looked up Allen's criminal record and found that he had pleaded guilty to sexually assaulting a minor several years earlier. (Allen says he was falsely accused by the girl's mother after the two had a failed relationship.) Never mind that police had initially been looking for a white man and had no way of connecting Allen to Smith. Here was a Joseph with a prior sex crime conviction. The panic was on. New alleged victims came forward, and Allen was arrested.

Almost none of the alleged victims could identify Allen. In police reports and taped interviews that defense attorneys either never saw or saw only the day before the child witnesses testified, child after child failed to pick Allen out of police lineups, despite persistent prodding by investigators. Incredibly, prosecutors spun this inability to identify Allen as proof of his guilt. The children, they said, were afraid of him, so they were afraid to look at him or to point him out. Of course, the few children who did identify Allen were also presented as evidence of his guilt.

Interview tapes show investigators leading children with their questioning, refusing to accept denials, and urging the children to help them protect other children by identifying their attackers. One psychiatrist asked to review the tapes told a local newspaper: "If these interviews were the basis of testimony on which people were convicted, it is an affront to justice. If people were convicted, it was on profoundly tainted testimony."

Head Start records showed that many of the children who alleged repeated abuse had perfect or near-perfect attendance records throughout the period when they supposedly were forced to participate in depraved orgies during school hours. Other Head Start employees gave testimony showing how implausible it was for these abuse rituals to have occurred without anyone—parents, teacher, neighbors, or administrators—noticing.

Prosecutors dismissed all of this testimony as attempts by Head Start employees to stave off a lawsuit against them and their employer. And it's true that the mother who first came forward with allegations was already preparing to sue. Another was also facing a criminal investigation of her own; she was suspected of getting illegal prescriptions for painkillers from a dentist.

In the end, Smith and Allen were convicted because jurors simply did not believe that so many innocent children (four in all) could make up such lurid tales of abuse. One juror would later explain, "I don't think [the children] could have gone into detail like that if they were lying."

If this case is like other wrongful ritual sex abuse convictions, the Lorain jurors were right. The children didn't make up those stories; the adults did. The preposterous fantasies in these cases—which have included horrific accounts of cannibalism, ritual murder, penetrating children with knives, and forced sex between children and animals—sprang from the minds of parents, cops, prosecutors, and child psychologists charged with protecting the kids.

The district attorney who oversaw the Lorain investigation, Greg White, later served as U.S. attorney for the Northern District of Ohio and is now a federal magistrate. The assistant district attorney who prosecuted the case, an aggressive rising star named Jonathan Rosenbaum, forced the resignation of local newspaper columnist Paul Facinelli after Facinelli wrote a series of hard-hitting columns and reports questioning the Smith and Allen convictions. In 2002 Rosenbaum himself was asked to resign after several controversial sex abuse cases, including one in which he charged a woman for photographing her 8-year-old daughter in the bathtub and another in which he pursued a case based on allegations gleaned from now-discredited "recovered memory" therapy. (In 2008 Rosenbaum was paralyzed from the waist down after he was shot by his son in a hunting accident.)

It may be true that Judge Burge exceeded his authority in ordering acquittals for Nancy Smith and Joseph Allen. But so did White and Rosenbaum by prosecuting them in the first place. Although the prosecutors failed to turn exculpatory evidence over to Smith's and Allen's attorneys, the Ohio Supreme Court upheld the convictions in 1996. Because the bar for winning a new trial is set so high, appeals courts tend to dismiss such state misconduct as "harmless error." When prosecutors break the rules in their pursuit of a conviction, it's a harmless error. But when a judge, outraged at the appallingly weak case that put two apparently innocent people in prison, reaches beyond his authority to correct the injustice, the forgiving appeals courts suddenly become sticklers for procedure.

Radley Balko is a senior editor at Reason magazine.