Qualified immunity is a plague on the criminal justice system, a made-up rule that allows countless government officials to violate Americans’ constitutional rights with impunity. On Tuesday, however, the 6th U.S. Circuit Court of Appeals issued a rare decision denying qualified immunity to a law enforcement officer who allegedly engaged in horrific misconduct that, in other contexts, might constitute sexual assault. The case highlights just how appalling an official’s malfeasance must be for his victim to receive a semblance of justice in court.

The ghastly chain of events in Campbell v. Mack were set off when Kevin Campbell, a black man, drove past Daniel Mack, a white police officer in Allen Park, Michigan. Campbell was driving his wife’s new minivan, which had a temporary license plate clearly displayed on the back window in compliance with the law. But Mack pulled him over, ostensibly for driving without a license plate. Campbell revealed that he did not have a driver’s license, but handed Mack his state ID card, as well as the new vehicle’s paperwork. Mack ordered him out of the car.

As soon as Campbell exited the car, Mack handcuffed and frisked him, then put him in the back of his cruiser. Campbell complained that the handcuffs hurt his wrists; in response, the officer allegedly tightened them and said, “that’s the loosest they’re going to get.” He also accused Campbell of stealing the minivan. Mack put his police dog directly into Campbell’s car, then searched it himself—all without any apparent probable cause.

The officer then took Campbell to the police station, where he uncuffed him. Campbell noted that the handcuffs were too tight and showed Mack the bruises they had left. Mack told him that “handcuffs leave marks on everybody.” (Campbell later received treatment for his damaged wrists at a hospital.) Mack then said he believed Campbell was hiding drugs and needed to perform a strip search, though he did not attempt to obtain a warrant. The officer put Campbell in a cage and told him to take off his pants.

Campbell objected, but Mack allegedly directed him to “get naked” and “drop his draws,” telling him: “You’re in a holding facility. You’re getting naked.” Asserting that he detected “a narcotic odor,” Mack told Campbell: “We’re getting down to the nitty-gritty.” Campbell said that was “not possible” because he did not do drugs, but Mack insisted that he was hiding narcotics, declaring: “Your pants are unzipped. I’m gonna find it one way or another, all right. So we can do this the easy way or the hard way. What do you got in your drawers?” (Campbell denies that his pants were unzipped.)

Mack then pulled down Campbell’s pants and underwear, bent down, and examined Campbell’s genitals. Campbell repeatedly asked the officer to stop and told him, “Nah, you can’t do that, man,” but Mack responded, “Yes, I can, yes, I can,” and escalated the search. Mack allegedly felt underneath Campbell’s genitals, telling another officer he had drugs “tucked underneath his balls” or “tucked in his fucking ass crack.” Campbell claims that Mack also “grabbed” and “pulled” his testicles and “stuck his finger inside of my anus.” Eventually, the officer gave up and told Campbell: “You can keep it,” referring to these putative drugs. No narcotics were ever found.

Mack contests Campbell’s version of the events, contending that, among other things, he never inserted his finger into Campbell’s anus. A camera captured the incident, but the video quality is poor, and the officers positioned themselves in a way that blocked a clear image of the search. The video does, however, show Campbell saying, “Why are you putting your finger in my [anus]?” and the officer responding at one point, “Because you have it tucked in your [body].”At this stage, though, the factual dispute doesn’t much matter. Campbell simply wants the case to go to trial so he can prove his claims to a jury. He is suing Mack for violating his First and Fourth Amendment rights, accusing him of retaliating against his protected speech and performing an unreasonable search and seizure. But Mack raised qualified immunity, arguing that his actions, as alleged by Campbell, did not violate any “clearly established” constitutional right. If Mack had received qualified immunity, Campbell’s case would never go to trial; it would be dismissed, because Mack would be shielded from liability.

The ruling is a reminder of the vagaries of qualified immunity.

But in an opinion by Judge Eric Clay, the 6th Circuit refused to grant Mack qualified immunity. It is clearly established, Clay wrote, that an officer “needs either probable cause or reasonable suspicion to conduct a traffic stop.” Mack had neither. It is also clearly established that an officer may not retaliate when a suspect contests “his or her allegedly unlawful treatment.” The First Amendment protects a suspect’s right to complain. Yet Mack did just that, allegedly tightening Campbell’s handcuffs and performing the body cavity search in an increasingly “aggressive, intimidating, and hostile manner” because Campbell protested. Under well-established 6th Circuit precedent, Mack’s actions, as recounted by Campbell, were obviously unlawful, so Mack must fight them at trial, and cannot hide behind qualified immunity.

This outcome is encouraging, though it’s unfortunate that the court issued the decision “unpublished,” meaning it will not serve as precedent in future cases. (Appeals courts can decide to keep their rulings unpublished, a controversial but common practice.) The ruling is also a reminder of the vagaries of qualified immunity: In the hands of a different court, it easily could’ve gone the other way. Judges have granted qualified immunity to one officer who shot an innocent man in his own home, another who let a police dog maul a homeless person, and even a social worker who strip-searched and photographed a 4-year-old girl without consent or a warrant. The doctrine has been invoked over and over again to insulate police from consequences when they shoot civilians. Justice Sonia Sotomayor has decried the Supreme Court’s “sanctioning” of this “ ‘shoot first, think later’ approach to policing.”

In recent years, a cross-ideological coalition of advocates—including the American Civil Liberties Union, the Cato Institute, Alliance Defending Freedom, Americans for Prosperity, the Institute for Justice, and Public Justice—have urged the Supreme Court to scale back or end qualified immunity. They argue that qualified immunity is itself unlawful, or at least extended far beyond what the law permits. It is, after all, a judge-made rule, untethered from any statute or constitutional command.

The Supreme Court has not yet agreed to reconsider its jurisprudence in this area. And until it does, only cases as egregious as Campbell’s—where the officer’s alleged actions would, in any other context, constitute criminal sexual assault—might defeat qualified immunity. Courts, meanwhile, can almost always pretend that an officer’s abuses don’t run afoul of “clearly established” law; consider a recent decision from the 9th U.S. Circuit Court of Appeals holding that the police did not violate clearly established law when they stole money from suspects. Until SCOTUS shrinks the scope of qualified immunity, rulings like Campbell v. Mack will remain the exception to the rule.