BROOKLYN (PIX11) — A Brooklyn man was sentenced Wednesday to up to five years behind bars for harassing a woman with transphobic and homophobic slurs before stabbing her in the shoulder, prosecutors announced.

Samuel Huff, 32, will serve two-and-a-half to five years in prison after pleading guilty to attempted assault as a hate crime for the attack.

Huff ran into the 33-year-old victim and a friend inside a bodega on Blake Avenue in East New York around 9:10 p.m. on May 7, 2020. He then followed the two women into a liquor store across the street, where he pointed at the victim and launched into an unprovoked tirade laced with offensive terms for gay and transgender people, prosecutors said.

The victim ignored Huff’s remarks, but he then followed the women outside the store and continued to verbally harass them as they got into a convertible, authorities said. Huff then lunged over the passenger side door and stabbed the victim in the shoulder with a sharp object before running off.

The victim suffered a cut to the shoulder and back that required seven stitches at Brookdale Hospital.

“Hate has no place in Brooklyn’s diverse communities, and this shocking and unprovoked act of homophobic violence underscores the importance of vigorous hate crime prosecutions to deter anyone who may consider acting on their bigoted views,” said Brooklyn District Attorney Eric Gonzalez in a statement. “Our dedicated Hate Crimes Bureau relentlessly pursues cases against those who victimize our neighbors because of their perceived race, sexual orientation, gender, ethnicity or religion and we are deeply committed to preventing these despicable offenses in Brooklyn.”