Three days after the assault, Mr. Dixon, of Classon Avenue in Brooklyn, turned himself in to the police and confessed, telling a detective he had flown into “a blind fury” when he discovered he was talking to a transgender woman. The next morning, he was videotaped repeating the story for prosecutors.

His confession notwithstanding, Mr. Dixon was not indicted until March 2015, because some witnesses had identified Paris Wilson, a casual friend of Mr. Dixon’s, as the attacker, muddying the investigation. In the end, charges were dropped against Mr. Wilson.

In his confession, Mr. Dixon said he and two friends had been drinking and were walking uptown on Frederick Douglass, headed to a party not far away. Near 148th Street, he said, he met Mr. Wilson and some other young men who were headed south and told him the party had been canceled.

Though he initially gave a different account of his encounter with Ms. Nettles, Mr. Dixon admitted while being questioned by a homicide detective that he had seen some of his friends talking to her and a second transgender woman, who was more heavy set and wore a white top and sandals. He crossed the street and began chatting with Ms. Nettles, whom he did not realize was transgender. “I remember asking her what is her name, where are you from,” he said. “That’s how I roll up.”

Then, he said, he heard one of his friends mocking him, saying, “That’s a guy,” and he became enraged. “They were clowning me,” he told the detectives.

It was not the first time he had been ridiculed, Mr. Dixon said in his videotaped statement. A few days earlier, he had been deeply embarrassed when two transgender women approached him while he was doing pull-ups on a scaffolding at 138th Street and Eighth Avenue. Not realizing they were transgender, he flirted with them, he said, and was teased badly by his friends.

Mr. Dixon, who is not charged with a hate crime, denied during his confession he had used slurs when he hit Ms. Nettles, as has been reported. He also declared he bore no hatred for transgender people as a group.

“I don’t care what they do,” he said. “I just didn’t want to be fooled.”