The feds have busted a former Brooklyn resident they called a top ISIS sniper who had visited Syria and gave “material support” to the bloodthirsty jihadis.

According to a criminal complaint released Friday, Ruslan Maratovich Asainov, 41, was a naturalized US citizen born in Kazakhstan who lived in Brooklyn between 1998 and 2013.

The accused terrorist was detained overseas by the Syrian Democratic Forces and was later transferred to US custody and arrived at JFK on Thursday, the feds said.

“In December 2013, the defendant traveled to Istanbul, Turkey, which is a common transit point to obtain entry into Syria. He subsequently entered Syria, joined ISIS, and became a sniper for the terrorist organization,” according to the complaint.

“Over time, the defendant rose through the ranks to become an ISIS ‘emir’ in charge of training other ISIS members in the use of weapons. He also attempted to recruit another individual to travel from the United States to Syria to fight for ISIS.”

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

Asainov then sent the informant two photographs showing him brandishing an assault rifle fitted with a scope.

He also sent a photo showing three dead fighters, and messaged a pal to praise ISIS.

“We are the worst terrorist organization in the world that has ever existed,” he said, adding that he wished to die on the battlefield.

“You will be f–king scared for the rest of your life. We will get you. We will f–king kill you. You heard of ISIS.

“We will get you. You need to obey. You need to be punished you f–king [redacted]. We will find you and teach you how to behave,” he said.

He later said his “faith in Islam” had been “renewed” in Syria, and he even asked the confidential 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 feds said they are determined to track down any other Americans who cast their lot with ISIS or other terrorist groups.

“The United States is committed to holding accountable those who have left this country in order to fight for ISIS,” said Assistant Attorney General John Demers.

“As alleged in the court filings, Asainov traveled overseas, joined ISIS, and became a fighter and a sniper for the terrorist organization. He was ultimately detained overseas, turned over to the FBI, and will now face justice in an American courtroom.”

The suspect will be presented in federal court in Brooklyn at 2 p.m. Friday before Magistrate Judge Steven Gold, when more details will be released.