CHICAGO (CBS) — A 19-year-old man has been sentenced to three years in prison for an accidental shooting that left a teenage boy dead last year in a home in the Humboldt Park neighborhood.

Orlando Gonzalez pleaded guilty Friday to causing child endangerment and aggravated unlawful use of a weapon, according to Cook County court records.

Mario Venegas Jr., 15, was with Gonzalez and a 17-year-old boy inside a home in the 2700 block of West Evergreen on the afternoon of Aug. 5, 2016, authorities said at the time.

The 17-year-old was handling a gun, which belonged to Gonzalez, when it accidentally discharged and shot Venegas in the head, authorities said.

Venegas, who lived in Bucktown, was taken to Stroger Hospital, where he died the next day, authorities said. An autopsy ruled his death a homicide.

The 17-year-old was charged with involuntary manslaughter and unlawful possession of a firearm by someone under 18, authorities said. His court information wasn’t available because he is a juvenile.

Judge Earl Hoffenberg sentenced Gonzalez to three years for each count, but the sentences will be served concurrently, according to Illinois Department of Corrections records. He will receive credit for 204 days served in the Cook County Jail, and must serve one year of supervised release.

He was booked into the Stateville Correctional Center to begin serving his sentence on Monday, according to IDOC records.

(Source: Sun-Times Media Wire © Chicago Sun-Times 2017. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)