Federal officials in Rochester, New York, have arrested and charged a local man who was allegedly plotting a New Year's Eve machete attack on diners at a local restaurant in the name of ISIS.

Emanuel Lutchman, 25, an ex-con Muslim convert with mental issues, was charged with attempting to provide material support to the terrorist group, federal prosecutors said.

The mayor of Rochester on Thursday cancelled the city's New Year's Eve fireworks celebration so that more police could be deployed to patrol, but officials said there is no information of a credible threat.

The FBI says Lutchman had pledged allegiance to ISIS leader Abu Bakr al-Baghdadi, wanted to leave to U.S. to live in the caliphate, and was in contact with a reputed ISIS member in Syria — who urged him to kill non-Muslims on the holiday.

"New years [sic] is here soon. Do operations and kill some kuffar," the overseas contact told him, the court papers allege.

Lutchman's grandmother, Beverley Carridice, told NBC News he had been plagued by psychiatric problems since childhood and had recently stabbed himself in the stomach during a suicide attempt.

Emanuel Lutchman, 25, charged with attempting to aid the terror group ISIS, is seen in this booking photo taken Dec. 31, 2015, in Monroe County, New York. Monroe County Sheriff

Raised as a Christian, he converted to Islam while serving a five-year prison sentence for robbery, she said, adding that she had never heard him express any radical thoughts or admiration for ISIS.

He called her after his arrest and said "it was a sting...they set him up," Carridice said.

Lutchman was nabbed with the help of confidential informants who received thousands of dollars from the FBI. One of them paid for the masks, zip-ties, knives, duct tape, ammonia and latex gloves that were allegedly supposed to be used in the attack, the court documents show.

In his conversations with the informants, Lutchman allegedly discussed using pressure cooker bombs or knives in an attack meant to impress his ISIS handlers, the complaint said.

"[T]hat's what my plan, that's on my mind, that's all I been thinking about," he said. "'Cause I'm getting amped up, to accept the fact that's what I gotta do."

On Dec. 28, he allegedly told an informant he wanted to sneak a bomb into a club or bar, kidnap a couple of people and kill them.

"I will take a life. I don't have a problem with that," he said.

This image made from video posted on a militant website Saturday, July 5, 2014, which has been authenticated based on its contents and other AP reporting, purports to show the leader of the Islamic State group, Abu Bakr al-Baghdadi, delivering a sermon at a mosque in Iraq. Militant video via AP file

The FBI arrested Lutchman on Wednesday and seized a video in which he swore allegiance to al-Baghdadi and claimed responsibility for the planned attack, authorities said.

Lutchman's grandmother said he is the married father of a 2-year-old boy. He had been having marital problems and had recently distanced himself from other family members.

She last saw him in August when he visited her in Florida. He was not taking his psychiatric medications at the time, she said.

She said did not believe her grandson could have masterminded an attack.

"Not on his own," she said. "He's not the type of person. But he's easily persuaded."

"His whole life is ruined," she said, crying.

"The FBI thwarted Emanuel Lutchman’s intent to kill civilians on New Year's Eve,” said Special Agent in Charge Adam Cohen of the bureau's Buffalo division.

"The FBI remains concerned about people overseas who use the Internet to inspire people in the United States to commit acts of violence where they live," Cohen said.

New York Gov. Andrew Cuomo said in a statement: "The arrest of Emanuel Lutchman is an important reminder of the new normal of global terrorism." He commended law enforcement and said every precaution is being taken to keep New Yorkers safe.

Lutchman is due back in court Jan. 8 at 11 a.m. The charge of attempting to provide material support to a terrorist organization carries up to 20 years in prison, the Department of Justice said.