A man pleaded guilty to killing a woman named Islan Nettles because she was transgender in Harlem in 2013. James Dixon, 25, copped to a manslaughter charge on Monday as part of a deal with prosecutors. He will get 12 years in prison, though prosecutors had asked for 17.

"With this conviction, James Dixon has finally been brought to justice for this brutal and lethal assault," Manhattan District Attorney Cy Vance said in a statement. "Members of the transgender community are far too often the targets of violent crime. I hope that this conviction provides some comfort to Ms. Nettles’ family and friends, and affirms my office’s commitment to protecting members of the LGBTQ community."

Dixon took the plea after a judge ruled that his taped confession could be shown to a jury at trial. In the course of three statements, Dixon reportedly said that he and a group of friends encountered a group of women while walking along Eighth Avenue near West 148th Street on a late summer night, "thinking they were girls," and that he tried to hit on Nettles.

Dixon said his friends heckled him, and he allegedly asked Nettles "if she was a guy," according to a detective's testimony. When Nettles said yes, Dixon allegedly pushed her, punched her in the face, knocking her down, and beat her further. When she fell, Nettles sustained a brain injury. She died five days later at Harlem Hospital.

Dixon allegedly wrote that he had "got fooled by a transgender" prior to the attack on Nettles, which could explain his "blind fury." The explanation is what's known as the "trans panic" defense, in which those who attack transgender people blame the victims by saying that they misrepresented their gender, the discovery of which made the attacker temporarily insane. The defense recently helped Marine Joseph Pemberton shave decades off of a prison sentence in the Philippines, for fatally choking a trans woman who he was hooking up with in a hotel room after discovering that she was "a man," which he said made him feel "raped." California banned the use of the defense in 2014.

Police had initially arrested another man, Paris Wilson, for the attack, and charged him with misdemeanor assault and harassment, but later dropped the charges. Police arrested Dixon in March 2015. Gay City News has documented inconsistencies in his alleged confessions—at one point in the videotaped statement, a detective tells Dixon, "What you’re saying doesn’t make sense."

In a 2015 jailhouse interview with DNAinfo, Dixon said, "They got the wrong guy. I didn't kill anyone." He claimed that he was at his aunt's house at the time of the fatal beating.