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.

READ MORE: CPS High School Dean Under Investigation For Homophobic Jokes On Facebook

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 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.

READ MORE: At Least 3 Killed, 43 Wounded In Weekend Shootings Across Chicago, Including Mass Shooting In Chatham

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.

MORE NEWS: 'Open Chicago' Concerts, Pop-Up Events, Markets Coming This Summer

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.