Police officers can barge into a house without a warrant or without announcing themselves and shoot someone if they fear for their life when they pull the trigger.

That’s what the Supreme Court ruled on Tuesday, when all eight justices agreed to strike down the 9th Circuit Court of Appeals “provocation doctrine” — the only court rule in the country that sought to hold cops accountable for their actions leading up to excessive use of force. (Neil Gorsuch wasn’t confirmed at the time of oral arguments.)

Courts generally side with police in complaints of excessive or deadly force if officers can demonstrate they reasonably feared for their safety or the safety of others in the moment. But the 9th Circuit’s now-defunct provocation doctrine, established in 2002, factored in the sequence of events that led up to an officer’s decision to reach for their gun, like whether they had violated someone’s rights.

“The rule’s fundamental flaw is that it uses another constitutional violation to manufacture an excessive force claim where one would not otherwise exist,” Justice Samuel Alito wrote in the majority opinion striking down the provocation doctrine.

The case, Mendez v. L.A. County, involved a couple — Angel Mendez and his pregnant girlfriend Jennifer Garcia — who lived in a shack in a friend’s backyard. After receiving a tip that a fugitive parolee was seen in the vicinity of the home, Los Angeles County sheriff’s deputies entered the shack, where the couple was napping at the time, without a warrant or identifying themselves as police. When Mendez woke up and allegedly reached for a BB gun he kept by his bed, the deputies opened fire. The couple survived, but Mendez needed his right leg amputated to the knee.

In a lawsuit the couple (who had since married) pursued against Los Angeles County, they claim the sheriff’s deputies violated their Fourth Amendment rights for three reasons: The police entered without a warrant, didn’t knock or announce themselves, and used excessive force.

A federal judge in California ruled in favor of the Mendezes on all three counts and awarded them $4 million. After Los Angeles County appealed, the 9th Circuit upheld the decision, and the case went to the Supreme Court.

In its unanimous decision Tuesday, the Supreme Court justices ruled the provocation doctrine doesn’t fall under the Fourth Amendment, even if the officer unreasonably provoked the encounter — like entering without a warrant. The doctrine, according to the justices, also undermined an earlier Supreme Court ruling, Graham v. Connor, which held that cases involving excessive force should be treated on a case-by-case basis and with “objective reasonableness.”