A U.S. citizen, originally from Kazakhstan and living in New York, was a sniper who trained ISIS fighters in Syria, federal prosecutors said Friday.

Ruslan Maratovich Asainov, 42, a naturalized citizen who lived in Brooklyn, was detained overseas by Syrian Democratic Forces and arrived at John F. Kennedy International Airport in Queens on Thursday. He has been charged with providing and attempting to provide material support, including training, services and personnel, to ISIS, according to a statement from the Justice Department.

Asainov flew from New York, where he had lived since 1998, to Istanbul, which is a common entry point into Syria, in late 2013, according to court documents filed in Brooklyn federal court.

From Turkey, he traveled to Syria and became an ISIS fighter and sniper, according to a criminal complaint.

Prosecutors said Asainov was in contact with at least two people during his five years in Syria — one person who he was threatening and one person he was trying to recruit but didn't know was a confidential informant for the New York City Police Department.

He sent photos of himself and other ISIS fighters in combat, prosecutors said. One showed three dead soldiers, who he called "young men, friends, who died in the last battle,” adding that “we are dying here," court documents said. At least one of the soldiers was wearing a patch identifying him as an ISIS fighter.

Asainov tried to convince the informant to join ISIS, telling him that he would help him get from Turkey to Syria, where he would be provided with a job, housing, food and a stipend after joining ISIS. He told the informant that because he was fluent in English, he would be helpful to ISIS' media relations.

He also asked the informant for $2,800 to buy a scope for his rifle and later sent the informant a picture of him with a rifle, saying it was "normal" for him to be carrying the weapon, according to the criminal complaint.

In other messages, Asainov said ISIS was the "the worst terrorist organization in the world that has ever existed” and said his "faith in Islam had been renewed since arriving in Syria."

"The defendant rose through the ranks to become an ISIS 'emir' in charge of training other ISIS members in the use of weapons," and was in charge of training other ISIS fighters in the use of weapons, the court documents said.

He is also accused of threatening someone that ISIS “will f------ kill you” and that the individual should be “f------ scared for the rest of your life.”

Asainov appeared before a judge on Friday and was ordered held without bail. During the brief hearing, he barely spoke and when asked why, his lawyer, Susan Kellman said he "answers to a higher authority." She confirmed that she meant Allah.

Kellman said her client has been "very pleasant and forthcoming" but did not immediately reply to a request for further comment.

Asainov could face up to 20 years in prison.

"As we allege today, Asainov left this country to do just that. He turned his back on the ideals we value, and he’ll now be made to face our justice system head-on," said William F. Sweeney Jr., the assistant director in charge of the FBI’s New York Field Office.

“This arrest serves as a warning to anyone anywhere in the world who intends to support or conduct attacks on behalf of terrorist groups against the United States — you will be brought to justice,” added NYPD Commissioner James P. O’Neill.