ROCHESTER, NEW YORK – An ex-convict seeking to prove he was worthy of joining the Islamic State group planned to carry out a New Year’s Eve attack at an upstate New York bar using a machete and knives provided by an FBI informant, federal authorities announced Thursday.

Emanuel Lutchman, 25, of Rochester, was charged with attempting to provide material support to terrorists, prosecutors said. Officials said he was caught in an FBI sting involving three paid informants.

Lutchman is a self-professed convert to Islam who claimed to receive direction from an overseas Islamic State member and planned to carry out an attack at a bar-restaurant in Rochester on Thursday, authorities wrote in court papers. The name of the business wasn’t released.

According to the FBI, Lutchman and an informant bought knives, a machete, ski masks and plastic cable ties for the attack. Lutchman had no money, so the informant paid $40 for the items, according to the complaint filed in federal court in Rochester.

He was described in court papers as having a criminal history stretching back a decade, including a 2006 robbery conviction that led to a five-year prison stint and arrests for what was described as “mental hygiene” issues.

The FBI said Lutchman has been communicating with three of its confidential sources since November in conversations that were sometimes recorded. During those conversations, Lutchman expressed strong support of the Islamic State and a desire to join it in Syria, according to a criminal complaint.

In recent days, Lutchman told one of the informants that he had communicated with a “brother” in the Islamic State overseas, the FBI said. During online communications on Dec. 25 and Dec. 26, the person overseas said Lutchman would have to prove to the group that he was one of them by praying regularly and by planning an “operation” on New Year’s Eve, Lutchman told the informant, according to the FBI.

According to court papers, the overseas individual told Lutchman he was “behind enemy lines” and that Lutchman was the closest person to their most hated enemy: the United States.

After Lutchman told the overseas individual he hates it in the U.S. and was ready to “give everything up” to join the Islamic State, the individual wrote online to Lutchman: “For now do wat u can over there,” the complaint said.

On Sunday, Lutchman sent a message to one of the FBI’s confidential sources, including an audio recording in which Lutchman swore allegiance to the Islamic State and its leader, the FBI said.