NEW YORK (CBSNewYork/AP) — A New York City man has been arrested on charges he tried to join the Islamic State group.

A criminal complaint unsealed Tuesday in federal court in Brooklyn accuses Parveg Ahmed of sending messages on social media about his support of the Islamic State group. It also says the 22-year-old Queens resident traveled to Saudi Arabia in June with others in a failed attempt to join the militant group.

READ MORE: Vaccine Mandate For NYC Teachers, Department Of Education Workers Put On Hold By Federal Judge

“Parveg Ahmed attempted to travel to Syria aligning himself with ISIS instead of his fellow Americans. Like others before him who chartered a similar path to join this violent terror group, Ahmed now finds his journey ends the same way – in a New York courtroom answering for his actions,” said FBI Assistant Director-in-Charge William F. Sweeney.

“This man betrayed his own country to allegedly take up arms against it in the name of ISIS,” stated HSI Special Agent-in-Charge Melendez.

“Mr. Ahmed also took extraordinary measures to destroy the electronic foot print he created,” said Police Commissioner James P. O’Neill.

Investigators say they found material justifying 9/11 and a picture of men hanging by their necks with the words, “gay men are to be hanged” on Ahmed’s phone, WCBS 880’s Alex Silverman reported.

READ MORE: Gabby Petito's Father Announces Creation Of Gabby Petito Foundation Ahead Of Public Memorial Service

“It truly is a disgrace to our community,” said Mike Pecchillo, who lives across the tree-lined street of two-story beige row houses.

He said he never noticed anything odd.

“I try not to think like that, because of the community we live in, I’d be paranoid my whole life. But no,” Pecchillo said.

U.S. officials say he was detained in an unnamed country bordering Syria and sent back to New York City on Monday night.

Parveg was to appear in court later Tuesday. There was no immediate information on a lawyer who could comment on his behalf.

MORE NEWS: Gov. Kathy Hochul Increases Pressure On COVID Vaccine Holdouts As Deadline For Health Care Workers Approaches

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)