A Commack man, who had traveled twice to Syria to wage “violent jihad,” has been indicted on terrorism charges, according to officials.

Elvis Redzepagic, 26, pleaded not guilty Wednesday in federal court in Central Islip to two counts of attempting to provide material support to a foreign terrorist organization.

Redzepagic traveled to Turkey in 2015 and to Jordan in 2016 in unsuccessful attempts to enter Syria in order to join either ISIS — also known as the Islamic State — or an al-Qaida affiliate named Jabhat al-Nusra, officials have said.

He told investigators he was “prepared to strap a bomb on and sacrifice himself,” according to a complaint filed when Redzepagic was arrested in March.

At that time, Redzepagic’s attorney, federal public defender Mildred Whalen, issued a statement saying that her client “is an American citizen who has been fully cooperative with the government’s investigation. We hope to work with Mr. Redzepagic’s family to show the Court and the government that Mr. Redzepagic needs treatment and care, not imprisonment.”

Later his attorneys said, given his cooperation, “we hope that the government will support our efforts to help this young citizen who went astray because of mental illness and drug use.”

advertisement | advertise on newsday

Redzepagic said little during Wednesday’s hearing, pleading not guilty and answering “yes” to standard questions.

U.S. Magistrate A. Kathleen Tomlinson ordered Redzepagic to remain in jail without bail.

Redzepagic’s attorney at the hearing, federal public defender LaKeytria Felder, declined to comment after the court appearance, as did Eastern District Assistant U.S. Attorney Artie McConnell.

Redzepagic has been questioned by FBI Joint Terrorism Task Force agents after his family called Suffolk 911 twice asking police to remove him from their home because of violent behavior, including threatening to cut off his mother’s head and attempting to use a knife to cut off his tattoos, according to federal prosecutors.

The questioning occurred also after Suffolk police had arrested Redzepagic on a marijuana charge.

Redzepagic told Suffolk police: “I’m going to leave this country and I’m going to come back with an Army — Islam is coming,” court papers said.

The papers also said Redzepagic told investigators that he was “prepared to strap a bomb on and sacrifice himself.”

Redzepagic said he was specifically attempting to get into Syria to join a cousin who was a jihadist there. He does have a cousin who is a leader in a Syrian terrorist organization, sources have said.