A black New York City man who attacked three white people, killing one of them, after making violent racial threats has been sentenced to 25 years in prison.

Manhattan District Attorney Cyrus R. Vance Jr. says 44-year-old Lashawn Marten was sentenced Tuesday for the attacks in September 2013 at Union Square.

“There is no justification for street violence of any kind, but street violence fueled by hatred and prejudice is particularly inexcusable,” Vance said in a statement. “As the jury concluded, this was not a series of random attacks. Lashawn Marten targeted victims solely on the basis of their skin color.”

Vance said Marten, who reportedly lived in a homeless shelter for mentally ill people, had repeatedly threatened to "knock out" the first white person he saw.

When 62-year-old Jeffrey Babbitt walked by, Martin punched him in the face. Babbitt fell and hit his head on the pavement. He died days later.

Two white bystanders were punched while trying to help Babbitt. One of them was knocked unconscious.

Marten was convicted of manslaughter and assault as hate crimes. His lawyer had said Marten didn't intend to cause serious injury and was in the throes of a schizophrenic breakdown during the attack. The court said he shouldered some of the responsibility for the attack because he refused medication.

Marten was asked if he wanted to speak in court, and issued a brief apology to Babbitt’s family, the New York Times reported.