The crime was brutal. On November 4, 1989, after a night of heavy drinking, David Scott Detrich and a male coworker picked up a woman walking along the side of the road in Tucson, Arizona. After scoring some cocaine, the trio went back to her place, where, according to court documents, Detrich slit the woman’s throat and stabbed her 40 times. Later, the two men dumped her body in the desert.

A jury convicted Detrich of kidnapping and first-degree murder in 1995, and a judge sentenced him to death.

Detrich is still on death row today as the appeals process drags on, but in 2010, his lawyers achieved a victory of sorts. They claimed that Detrich had received “ineffective assistance of counsel” at his trial, because his original legal team had failed to present evidence of neuropsychological abnormalities and brain damage that might have swayed the court to give him a lesser sentence. A federal appeals court agreed. The ruling said, in effect, that Detrich had been denied his Constitutional right to a fair trial because his lawyers hadn’t called an expert witness to talk about his brain.

That judicial opinion is just one of nearly 1,600 examined in a recent study documenting the expanding use of brain science in the criminal-justice system. The study, by Nita Farahany at Duke University, found that the number of judicial opinions that mention neuroscientific evidence more than doubled between 2005 and 2012.

“There are good reasons to believe that the increase in published opinions involving neurobiology are just the tip of the iceberg,” says Owen Jones, a law professor at Vanderbilt who directs the MacArthur Foundation Research Network on Law and Neuroscience. The vast majority of criminal cases never go to trial, Jones says, and only a small fraction of those that do result in written opinions. The rest are virtually impossible to track.

It’s a trend that makes some neuroscientists uneasy, as they see the potential for their findings to be misused in court. But like it or not, Farahany’s findings suggest, neuroscience is already entrenched in the U.S. legal system.

A handful of cases have made headlines in recent years, as lawyers representing convicted murderers have introduced brain scans and other tests of brain function to try to spare their client the death penalty. It didn’t always work, but Farahany’s analysis suggests that neuroscientific evidence—which she broadly defines as anything from brain scans to neuropsychological exams to bald assertions about the condition of a person’s brain—is being used in a wider variety of cases, and in the service of more diverse legal strategies, than the headlines would suggest. In fact, 60 percent of the cases in her sample involved non-capital offenses, including robbery, fraud, and drug trafficking.

Cases like Detrich’s are one example. Arguing for ineffective assistance of counsel is pretty much a legal Hail Mary. It requires proving two things: that the defense counsel failed to do their job adequately, and (raising the bar even higher) that this failure caused the trial to be unfairly skewed against the defendant. Courts have ruled previously that a defense attorney who slept through substantial parts of a trial still provided effective counsel. Not so, at least in some cases, for attorneys who failed to introduce neuroscience evidence in their client’s defense.

Farahany found 516 claims in which neuroscience evidence was used to argue for ineffective assistance of counsel (a claim, in the legal sense, is a formal demand or assertion). Only 29 percent of these claims were successful, but that’s still a surprisingly high number, she says: “The basic rap on IAC is it almost always fails.”

Neuroscience evidence was also used in 395 competency claims, which are claims regarding a defendants’ mental wherewithal to stand trial, waive their rights, or enter a plea.

In the 2008 case of Miguel Angel Ruiz, a 17-year-old accused of killing his mother, a jury in California apparently was unmoved by two neuropsychologists, who testified that Ruiz had severe language deficits resulting from a brain injury. The jury rejected the claim that Ruiz was not competent to stand trial, but the trial judge disagreed. “I’m not inclined to set aside a jury’s decision lightly or unadvisedly,” he wrote in his decision to do just that. “I just couldn’t believe the jury could return a finding of competency based on the evidence I heard.”

In the Ruiz case, it seems the neuroscience evidence had an impact. The effect on Detrich’s case, which is still bouncing around the courts, is less clear. Overall, it’s hard to know how influential this type of evidence really is, Farahany says. Each case is unique, which makes it difficult to do a fair comparison of outcomes. Even so, she found that in cases that used neuroscientific evidence, defendants got a favorable outcome—a reduced sentence, a new hearing, or some other kind of break—about 20 to 30 percent of the time. That’s considerably better than the 12 percent reported in a 2015 paper that looked at an entire year’s worth of appeals in criminal cases in the U.S.—nearly 70,000 of them. “Percentage-wise, people seem to do a little better with neuroscience than they do with out,” Farahany says.

Courts have always concerned themselves with the mental states of individuals, says Francis Shen, a law professor at the University of Minnesota. What’s changing is the influence of modern neuroscience on how we talk about these things. “The logic is the same, but the stuff a jury or judge will hear is now technical in a way it didn’t used to be,” Shen says.

The big question, of course, is whether this this growing influence will end up being good or bad for justice. Brain scans or other biomarkers that could more definitively diagnose mental illness would indeed be a boon for the legal system, says Shen. But while scans today can easily pick up signs of major brain damage, scans that reliably pick up the more subtle signs of schizophrenia, for example, are still a ways off. “Once it becomes clinically relevant, it will become legally relevant,” Shen says.

It gets murkier, though, for biomarkers of legally relevant mental characteristics like impulsiveness. One problem is that most neuroscience research involves making comparisons of brain scans collected from dozens of people, while most court cases are concerned with a specific individual. “Seeing something on an individual's scan does not tell us they have impulse-control problems, it merely raises the likelihood by some unknown amount,” says Martha Farah, a cognitive neuroscientist at the University of Pennsylvania.

This is a tension that seems likely to grow. The scientific and legal communities have different methods and standards for evaluating evidence. Scientists have a culture of objectivity and a statistical mindset when it comes to uncertainty. The evidence they’re dealing with often comes from experiments of their own design.

In the courtroom, on the other hand, the evidence comes from real life. It’s messy and incomplete. And when someone’s liberty—or life—hangs in the balance, there’s no time to wait for more data to come in.