A man in New York who was accused of attacking a gay couple in “one of the vilest” hate crimes local prosecutors have seen has pled guilty.

Nicholas Ferlenda, 27, was facing one to three years of prison for beating two men after he saw one of them put his arm over the shoulders of the other. But the plea deal, which was proposed by state Supreme Court Justice Gordon Cuffy, got him a maximum of six months of prison and five years of probation.

Related: A couple was attacked for holding hands at Miami Pride. How the police reacted made it worse.

Investigators believe that Ferlenda got enraged at the sight of the gay couple together as they were leaving a concert at the Great New York State Fair in Syracuse this past August 24.

Ferlenda allegedly punched one of the men in the face, starting a rage-fueled attack that lasted half an hour, as the couple tried to escape on foot and then by car.

Ferlenda followed them, shouting anti-gay slurs. And he didn’t stop when they got to their car.

“When the two male victims entered their vehicle and attempted to exit the parking lot, Ferlenda punched the driver’s side window causing it to smash,” said the police report.

Ferlenda was covered in blood when he was arrested by state troopers due to injuries on his arm that were caused by smashing in the window.

“This is one of the vilest things we’ve seen,” said prosecutor Anthony Mangovski. “The amount of hate that man exhibited was absurd.”

He told Syracuse.com that Ferlenda’s “unbelievable” hatred rivaled that which is usually seen in stabbings or shootings.

Ferlenda pled guilty to two felony hate crimes, assault, and criminal mischief. If his attack wasn’t bias-motivated, he only would have faced misdemeanor charges.

The judge warned Ferlenda, who was drunk at the time of the attack, not to drink in public before his sentencing hearing in April.

He will have to undergo diversity training as part of his plea deal and pay for the broken window if it’s not covered by insurance.