A Texas jury ruled Tuesday that a white police officer who shot and killed an innocent black man in his own home is guilty of murder. The conviction came even after a widely criticized last-minute decision from a judge, which allowed jurors to take into account a controversial law that could have cleared her of wrongdoing.

Dallas County District Court Judge Tammy Kemp ruled Monday that the jury could consider the state’s “castle doctrine” in the trial of Dallas police officer Amber Guyger, who said she mistakenly walked into the apartment of Botham Jean, a 26-year-old accountant who lived one floor above her, and then shot him dead in September 2018 because she thought he was a burglar.

The judge’s decision to allow the defense to use the law, which says your home is your castle and you have a right to defend it, raised the bar for prosecutors and sparked outrage and disbelief from critics who questioned how the law could have protected Guyger when she shot Jean in his own apartment.

The case has split public opinion. Civil-rights activists view Jean’s death as another example of police brutality against innocent black people. But local law enforcement see the charges, which came amid a recent flurry of indictments of Dallas officers, as an indication that former district attorney Faith Johnson was acquiescing to a “narrative that cops are bad,” a police union president told the Dallas Morning News.

Guyger admitted on the stand that she shot to kill the young man because she thought he was burglarizing her apartment. Because of that mistake, her defense was built on a self-defense claim and after Kemp’s 11th-hour ruling during a conference with attorneys on Monday, the Texas “castle doctrine.”