CHICAGO (CBS) — A Cary man has been sentenced to 12 years in prison, after pleading guilty to attacking another man with a nail gun during a home invasion last year.

Edward Zegers, 53, pleaded guilty to home invasion and domestic battery, according to the McHenry County State’s Attorney’s Office.

Zegers was arrested on July 2, 2017, after he broke into a home in the 7300 block of Swan Way in unincorporated Cary. Police and prosecutors said Zegers forced his way into the home, got into a fight with another man, and hit the man in the head with a concrete nail gun.

edward zegers Man Sentenced To 12 Years For Hitting Man With Nail Gun During Cary Home Invasion

Edward Zegers pleaded guilty to charges of home invasion and domestic battery, and was sentenced to 12 years in prison for hitting a man with a nail gun during an attack in Cary, Illinois, in July 2017. (Credit: McHenry County State’s Attorney)

Police found Zegers in a bedroom of the home, with injuries to his face from the fight. He was arrested and charged with attempted murder, home invasion, and residential burglary.

Zegers and McHenry County prosecutors reached a plea agreement on charges of home invasion and domestic battery.

Prosecutors said the domestic battery charge stemmed from an attack on a second victim in the home.

Zegers was free on $3 million bail before pleading guilty, but has been taken into custody. He was being held at the McHenry County Jail on Monday.