A 26-year-old ex-convict pleaded guilty in federal court Thursday to plotting a New Year's Eve machete attack at a Rochester restaurant in the name of the Islamic State terrorist group.

Emanuel Lutchman, of Rochester, pleaded guilty to conspiracy to provide material support to a foreign terrorism organization, a charge that carries a maximum sentence of 20 years in federal prison, U.S. Attorney William Hochul said. He'll be sentenced Nov. 15 in U.S. District Court in Rochester.

Officials say Lutchman explored websites related to violent jihad and initiated contact with now-deceased Islamic State terrorist Abu Issa Al-Amriki in Syria in December 2015. Prosecutors say Al-Amriki told him to plan an attack on New Year's Eve and kill non-believers, or "kuffar."

The FBI says it used paid informants to uncover the plot and take Lutchman to a Walmart store to purchase black ski masks, two knives, a machete, ammonia and other supplies for the attack.

On Dec. 30, 2015, prosecutors say Lutchman made a video pledging allegiance to the Islamic State in which he said, "the blood that you spill of the Muslim overseas we gonna spill the blood of the kuffar." Immediately thereafter, agents arrested him.

Lutchman's family told the Rochester Democrat and Chronicle he has a long history of mental problems and was unable to get a job after serving time in prison for robbing a man of his cellphone, bus pass and cigarettes when he was 16. His grandmother said he would never have carried out the attack.