A man accused of posting a broad online threat last week that spurred heightened security at Jewish synagogues and schools in New Jersey expressed admiration for white-supremacist mass murderer Dylann Roof and said his planned attack was in retaliation for the 2019 mosque shootings in Christchurch, New Zealand, federal prosecutors said in announcing a criminal charge Thursday.

Omar Alkattoul, 18, of Sayreville, is charged with transmitting a threat in interstate and foreign commerce and was scheduled to make his initial court appearance in Newark on Thursday afternoon, where he will be represented by a federal public defender. That office generally does not comment on cases.

Alkattoul could face up to five years in prison if convicted.

NEW JERSEY SYNAGOGUE THREAT THAT DREW FBI ATTENTION IS 'MITIGATED,' MURPHY SAYS

According to a criminal complaint filed in federal court, Alkattoul expressed hatred of Jews and admitted posting online that "God cursed the Jewish people and God should burn gay people." He also told investigators he had researched how to obtain a gun, shooting ranges, and mass shootings but in the days before posting his threat was "about ‘50/50’" on whether he would actually carry out an attack.

Alkattoul allegedly discussed his plan to kill as "an act of revenge" for the death of Muslims, authorities said. They have previously said they did not believe he had the means to carry out any specific attack.

In a series of online messages, Alkattoul said it would take him years to plan and gather resources to carry out an attack and that it would be in retaliation for the Christchurch attacks that killed more than 50 people, according to the complaint.

N.J. synagogue threats

Police are seen outside a synagogue in Hoboken, N.J. on Nov. 3, 2022, the day the FBI issued a statewide alert on a threat made against houses of worship. (AP Photo/Ryan Kryska)

About Roof, who killed nine members of a Black South Carolina church congregation in 2015, Alkattoul allegedly said in a private online message that "a lot of Muslims in the west should learn from him."

Alkattoul used a social media app on Nov. 1 to send a link to a document entitled "When Swords Collide," according to prosecutors, and he admitted to the person he sent it to that he wrote the document, stating: "It’s in the context of an attack on Jews." According to the second individual, Alkattoul also sent the document to at least five other people using another social media application.

The FBI issued a statewide alert on Nov. 3 and announced a suspect had been identified the next day, but they did not identify him at that time. The warning prompted some municipalities across the state to send extra police officers to guard houses of worship and schools.

NEW JERSEY SYNAGOGUES ARE UNDER 'CREDIBLE' THREAT: FBI

Public warnings about nonspecific threats against Jewish institutions, made by groups including Christian supremacists and Islamist extremists, aren’t unusual in the New York City area, and many turn out to be false alarms.

But the area has also seen deadly attacks, including the firebombings of two synagogues and an attack on a rabbi’s home in 2012, a fatal stabbing at a Hanukkah celebration in 2019, and a shooting in 2019 that killed three people in a kosher market and a police officer.

CLICK HERE TO GET THE FOX NEWS APP

Outside the New York City region, the massacre that killed 11 people at the Tree of Life synagogue in Pittsburgh four years ago left an indelible mark.