The stalking charge against Mr. Luthmann was also related to Ms. Materna’s fake profile, Mr. Nelson said. Some of the information posted there, including a report that she parked in a disabled parking space, led to personal attacks and threats against her, the prosecutor said.

A year later, Mr. Luthmann created another fake social media account for City Councilwoman Debi Rose, a Democrat representing the island’s northern neighborhoods, Mr. Nelson said. At the time, Ms. Rose was facing a primary-election challenge from Kamillah Hanks, a community organizer. That page, among other things, said Ms. Rose “welcomes” a welfare hotel for drug addicts and criminals.

Both Ms. Hanks and Mr. Castorina denied in interviews last year being involved in the fake Facebook pages. But records showed that Mr. Luthmann was paid $1,650 for petitioning expenses by Ms. Hanks’s campaign, and Facebook Messenger conversations reviewed by The Times suggested both politicians were tied to Mr. Luthmann’s efforts.

Mr. Luthmann is currently in jail awaiting trial in an unrelated federal fraud case, in which he is accused of a string of bizarre crimes. When asked last year, he would neither confirm nor deny that he had created the false Facebook pages, but he said that there would be nothing wrong if he had. “It’s what is called a dirty trick,” Mr. Luthmann said.

Mr. Luthmann’s lawyer, Joseph Sorrentino, said on Friday that neither he nor his client have had a chance to fully review the charges. But Mr. Sorrentino added that he did not believe that New York law made it illegal to do some of the things that prosecutors have accused Mr. Luthmann of doing.

“If you look at the indictment, my client is alleged to have falsified the business records of Twitter and Facebook,” he said. “And I don’t believe that as a third party user of those sites, he can do that.”

Last December, federal prosecutors accused Mr. Luthmann of working with two reputed mobsters and a blind man to pack shipping containers with “cheap filler,” which they then fraudulently sold as scrap metal to local businesses. Then, prosecutors said, he turned on one of his partners and had him held at gunpoint to collect a $7,000 debt.