In 2004, 16-year-old Cyntoia Brown shot and killed a man. She was working as a prostitute and the man she killed had allegedly solicited her for sex. According to Brown, he picked her up off the street in a truck and drove her to his home, where the two got into bed. Brown says that, at some point, the man reached suddenly under his bed. She thought he was reaching for a weapon, she says, so she pulled a handgun from her purse on the nightstand beside her and shot him. She took some money and two guns from the home before leaving. Brown says she was forced into prostitution by Garion "Cut Throat" McGlothen, a pimp, after running away from home in Nashville. Brown also alleges that McGlothen regularly physically abused her and forced her to do drugs. She returned to a hotel room she shared with McGlothen after her alleged crime. It was there that she was later arrested. Brown said she acted in self-defense. She claimed the man behaved oddly throughout their time together and showed her his collection of guns before the two got into bed. Still, prosecutors charged Brown with first-degree murder, deciding that she’d killed the man in cold blood in order to rob him. In court, they pointed out that the man had been shot in the back of the head and argued that he was asleep when Brown pulled the trigger. That added to Brown’s theft of money and guns equaled robbery and premeditated murder. Jurors agreed and Brown was convicted of murder after six hours of deliberation. A judge sentenced her to 51 years to life in prison, making her eligible for parole when she’s 69 years old. Brown has spent more than a decade behind bars, but her case is now receiving national attention due to a social media campaign to free her led by celebrities including singer Rihanna, Kim Kardashian West, and basketball player LeBron James. “Did we somehow change the definition of justice along the way?” Rihanna asked in her post about Brown’s case. “The system has failed,” insisted Kardashian West. What happened to Brown certainly upsets any reasonable person’s sense of justice but, sadly, her prosecution, conviction, and sentence fit within the letter of the law. In fact, an analysis of the details in her case against the law suggests that the criminal justice system didn’t fail Brown. Rather, it simply wasn’t designed to protect her. First, laws defining self-defense aren’t as straightforward as most might assume. They vary by state with a number of different standards and exceptions. Tennessee’s laws are especially complicated, protecting some but leaving giant holes for others like Brown to fall through. Under Tennessee law, individuals are allowed to use force, including deadly force, if they reasonably perceive a threat to themselves or others. The law allows for the use force proportionate to the threat and specifies that an individual has no obligation to retreat before using force. Based on that definition of self-defense, Brown shouldn’t be in prison today. She was a young girl constantly surrounded by danger. She was in a strange setting with a man she did not know but whom she knew to be armed. She was frightened when he reached suddenly under his bed and acted to save her life. It’s a defense that might have held up if Brown was a vigilante in Florida or a police officer anywhere. But Brown was neither; she was a sex-worker and, according to the state of Tennessee, a sex-worker has no claim to self-defense. Specifically, the law states that self-defense applies in the scenario described above notwithstanding, “the person using force is engaged in an unlawful activity.” That provision alone practically sealed Brown’s fate. Further, Tennessee law allows for anyone at least 16 years old to be tried as an adult for any criminal offense. Finally, after being convicted, Brown was sentenced to the least of two penalties for murder for juveniles in Tennessee. She was given life with the possibility of parole. The only other option was life without parole. The laws have changed some since Brown was sentenced. In 2011, in a move to curtail sex-trafficking in the state, Tennessee changed its laws so that individuals under the age of 18 can’t be charged with prostitution. On the federal level, the Supreme Court moved in 2012 to ban mandatory life-without-parole sentences for juveniles, ruling that the practice violates Eighth Amendment prohibitions against cruel and unusual punishment. Neither of those developments means anything for the prospect of Brown’s release, however. In the end, if Cyntoia Brown is to be released from prison, it’ll likely be as an old woman or because the governor of Tennessee believes that she deserves some mercy—not because the law, as written, showed her any. Donovan X. Ramsey is the commentary editor at The Marshall Project.