BUFFALO, N.Y. -- A man is headed to jail for shooting and killing his friend in Elma last year. 

Jake Klocek was sentenced to four to 12 years in prison Thursday morning.

He pleaded guilty to second degree manslaughter back in July. 

According to the Erie County Sheriff's Office, Klocek accidentally shot 19-year-old Anthony King in the stomach at a home on Dorris Drive in November 2016.

Klocek apologized to the King family before sentencing.