PATERSON -- The 18-year-old who was recorded "sucker punching" an elderly man will spend three years behind bars.

Kristian Gonzalez, of Paterson, was sentenced Friday to three years in prison after pleading guilty last month to aggravated assault and endangering an injured victim charges related to the "knockout attack," Passaic County Prosecutor Camelia Valdes announced in a release.

Gonzalez must serve a little over 21/2 years before he is eligible for parole, authorities said. He was also ordered to pay $1,499 in restitution to the victim of the attack, Cesar Najera, for medical bills and lost wages, Valdes said.

Najera, who reportedly suffered serious injuries after being randomly punched while on a Paterson street corner on Dec. 7, 2015, thanked law enforcement officials at the sentencing, authorities said.

Gonzalez, who was 17 at the time of the attack, will serve his term in a juvenile jail, officials said. The case against his 16-year-old friend, who authorities said filmed the attack and can be heard on the video encouraging Gonzalez, is still pending in Family Court, Valdes said.

The incident gained widespread attention after the "knockout game" video was posted on social media and went viral. After police used the video to identify Gonzalez and the other teen, Gonzalez turned himself in to police in February. His attorney, Harley Breite, said the teen received death threats after surrendering to police.

Gonzalez pleaded guilty on Aug. 31, admitting that his intent was to cause serious injury, and that he knew the punch knocked Najera unconscious.

Jessica Mazzola may be reached at jmazzola@njadvancemedia.com. Follow her on Twitter @JessMazzola. Find NJ.com on Facebook.