A former Brooklyn man accused of being a top ISIS sniper admitted he would “take up arms” in support of the terror group again if he was released, prosecutors claimed Wednesday.

Ruslan Maratovich Asainov, 42, who was busted in July on charges of providing material assistance to a terror group, was ordered to stay behind bars at his arraignment in Brooklyn federal court, with Judge Nicholas Garaufis agreeing he posed “a danger to the community.”

“He confesses that if he were released, he would take up arms in support of ISIS again,” prosecutor Saritha Komatireddy told the judge, who agreed to keep Asainov detained at Metropolitan Correctional Center, where he is under heightened security.

The Kazakhstan-born alleged jihadi appeared in the courtroom looking solemn, but refused to speak. His lawyer pleaded not guilty on his behalf — saying Asainov wouldn’t do it himself “because he doesn’t recognize the American system of laws.”

“He’s converted to Islam. He lives by Sharia law,” lawyer Susan Kellman told reporters after the proceeding. “He doesn’t believe he has any obligation to abide by the American legal system.”

Komatireddy told the judge Asainov was a “clear danger” and a flight risk, citing his contacts in both Syria and Kazakhstan.

“He considers himself a citizen of the Islamic state,” she said, adding that he was a “high-level member” of the terror group.

The feds say Asainov, who is a naturalized US citizen, moved to Syria six years ago to join ISIS but lived in Brooklyn from 1998 to 2013 — when he left behind his then-wife and young daughter in Bensonhurst.

While there, he was trained to be one of the terror group’s top snipers and firearms instructors, documenting it all in incriminating messages and photos, prosecutors allege.

In March 2015, he asked a confidential informant to send him about $2,800 so that he could buy a scope for his rifle, prosecutors claim.

He later asked the informant — and his family — to come join the fight, saying ISIS would provide food and $50 a month, and that even “grandmothers” were joining the battle.

The accused terrorist was detained overseas by the Syrian Democratic Forces, and was later transferred to US custody and brought to New York in July, according to the feds.

Asainov is scheduled to be back in court on Dec. 11.