Michael J. Zachery, 26, of Evanston.

An Evanston man whose accomplice was shot and killed during a botched robbery in Lindenhurst in 2018 has been sentenced to six and a half years in prison.

Michael J. Zachery, 26, of the 1600 block of Simpson Street in Evanston, was charged in October 2018 with first-degree murder and armed robbery.

The Lindenhurst Police Department was called to a home in the 300 block of Teal Road for a robbery around 2:30 a.m. October 16, 2018.

The 911 caller, who witnessed the incident from inside the home, told police that someone had been shot during a robbery.

Responding police officers found Joseph McHaney, 34, of Chicago, dead from gunshot wounds.

Zachery was arrested at the scene by police after being restrained by one of the residents of the home.

Lake County Major Crime Task Force Spokesman Christopher Covelli said at the time that Zachery and McHaney drove to the Lindenhurst home to purchase two rifles from the homeowner.

[Suggested Article]  People shot by water pellet gun in parking lot of Walmart in Woodstock, police say

Prosecutors said that shortly after the two arrived at the home, McHaney and the victim went to another room separate from Zachery.

Prosecutors said that McHaney struck the victim several times with a hammer. The victim shot McHaney multiple times, killing him.

Zachery, who tried fleeing the scene, was restrained before police arrived.

On Wednesday, Zachery pleaded guilty to one count of attempted armed robbery, a Class 1 felony, court records show.

In exchange, prosecutors dismissed his first-degree murder charge.

Lake County Judge James Booras approved the plea deal and sentenced Zachery to six years and six months in the Illinois Department of Corrections.

Zachery will receive 999 days of credit for time served in the Lake County Jail since his arrest.