NEW YORK (CBSNewYork) – FBI agents have arrested three Brooklyn men for allegedly attempting to travel abroad to join the terror group ISIS, with one man agreeing to kill President Barack Obama if ordered to, according to a criminal complaint.

As CBS2’s Dick Brennan reported, the trio had also discussed launching attacks domestically if they were unable to travel to join the terror group, authorities said.

Abdurasul Hasanovich Juraboev, Akhror Saidakhmetov and Abror Habibov face charges of conspiracy to provide material support to terrorists.

Back in the summer of 2014, Juraboev, 24, and Saidakhmetov, 19, had expressed support online for the establishment of an Islamic caliphate in Iraq in Syria, authorities said.

They went on to devise a plan to travel to Turkey and then Syria to wage jihad, authorities said.

As CBS2’s Jessica Schneider reported, Juraboev and Saidakhmetov lived together on East 10th Street in Midwood, Brooklyn, and worked together at a Middle Eastern fast food restaurant.

They allegedly bought tickets to Turkey separately at a travel agency. Habibov was accused of financing the travel.

A neighbor told CBS2’s Tony Aiello he couldn’t believe it.

“Nice guys,” said J.C. Carrasquillo of Midwood. “Very quiet.”

According to the complaint, Juraboev posted the following message on an Uzbek website.

“Greetings! We too wanted to pledge our allegiance and commit ourselves while not present there. I am in USA now but we don’t have any arms. But is it possible to commit ourselves as dedicated martyrs anyway while here? What I’m saying is, to shoot Obama then get shot ourselves, will it do? That will strike fear in the hearts of infidels.”

Federal agents became aware of the message and tracked the IP address back to Juraboev’s Brooklyn home. When confronted by agents, Juraboev said he wanted to travel to Syria to fight with ISIS or attack Obama if he could, according to authorities.

Juraboev later said he didn’t have the means or plan to attack Obama, according to authorities.

Authorities said Juraboev also was willing to plant a bomb at Coney Island if ordered to do so.

WEB EXTRA: Read the complaint (.pdf)

Saidakhmetov was arrested early Wednesday morning at John F. Kennedy International Airport as he was about to board a flight to Istanbul.

The feds had arranged for a confidential informer to befriend the young men, and court documents said the informant recorded Saidakhmetov making a threat against law enforcement.

Saidakhmetov allegedly plotted to buy a machine gun and kill police officers and FBI agents if he was unable to join ISIS in Syria, authorities said.

“I will just go and buy a machine gun, AK-47, go out and shoot all police,” Saidakhmetov said, according to the complaint. “We will go and purchase one handgun, then go shoot one police officer. Boom. Then, we will take his gun, bullets and a bulletproof vest… then we will do the same with a couple of others. Then we will go to the FBI headquarters, kill the FBI people.”

A sketch of defendants in Brooklyn federal court on accusations that they tried to join ISIS. Abdurasul Hasanovich Juraboev, Akhror Saidakhmetov and Abror Habibov face charges of conspiracy to provide material support to terrorists. (Credit: Jane Rosenberg)

A sketch of defendants in Brooklyn federal court on accusations that they tried to join ISIS. Abdurasul Hasanovich Juraboev, Akhror Saidakhmetov and Abror Habibov face charges of conspiracy to provide material support to terrorists. (Credit: Jane Rosenberg)

“The idea was made quite plain based on their own statements that if they were not able to, that they would seek to fire weapons here – handguns; a machine gun – and seek to attack, very specifically, police officers,” NYPD Commissioner Bill Bratton said at a news conference Wednesday afternoon.

The informant kept tabs on Juraboev and Saidakhmetov as they visited the travel agency and bought the tickets to Istanbul, authorities said. Saidakhmetov’s itinerary showed he was supposed to take off early Wednesday morning.

ISIS is also known as ISIL, which stands for the Islamic State of Iraq and the Levant.

“This is real, this is the concern about the ‘lone wolf,’ inspired to act without ever going to the Mideast or the concern of once they get to the Mideast, acquire fighting skills, capabilities and then attempt to return to the country,” Bratton said.

“We will vigorously prosecute those who attempt to travel to Syria to wage violent jihad on behalf of ISIL and those who support them,” said Brooklyn U.S. Attorney Loretta Lynch. “Anyone who threatens our citizens and our allies, here or abroad, will face the full force of American justice.”

U.S. Sen. Charles Schumer (D-N.Y) emphasized that plots like the one alleged Wednesday reflect a new reality in security threats.

“These were lone wolves,” Schumer said. “They don’t seem to be affiliated with any other terror organization, and this is our new danger in terrorism.”

Schumer added in a statement: “This foiled ISIS plot sends shivers down the spine of New Yorkers and clearly underscores that we must remain ever-vigilant in the face of terror threats, and that funding our national security must be a top priority of the federal government, at all times.”

FBI Assistant Director in Charge Diego Rodriguez also emphasized the potential danger of the alleged plot.

“The defendants looked to join the Islamic State of Iraq and the Levant, by flying to Turkey in a vain attempt to evade detection. And several of the defendants planned to commit acts of terror here—in America—if they could not travel, to include killing FBI agents. The defendants violated the true tenets of their faith in pursuit of their radical, violent agenda,” Rodriguez said. “We rely on help from the community, the public and religious leaders to be mindful of those who could be radicalized. We cannot do this alone.”

But Saidakhmetov’s defense attorney, Adam Perlmutter, questioned authorities’ version of events.

“We know from other cases that you know, informants are enormously manipulative. And these are snippets of conversations that are in the complaint,” Perlmutter said. “We do not know the context.”

The FBI said it used both wiretaps and the informant to follow the suspects, once they had made their intentions clear on the Internet.

“Our law enforcement was on top of these people, and were going to pounce upon them the minute they tried to do anything to create danger,” Schumer said.

Juraboev is also known as Abdulloh Ibn Hasan, according to the complaint. Juraboev is a permanent resident of the U.S. and is a citizen of Uzbekistan, officials said.

Saidakhmetov is also a permanent U.S. resident and is a citizen of Kazakhstan, according to authorities.

Habibov, 30, is an Uzbek citizen who operates kiosks that repair mobile phones and sell kitchenware in malls across the country, authorities said. Habibov was arrested in Jacksonville, Florida, 1010 WINS’ Juliet Papa reported.

In online conversations with an Iraqi man who administrates a website sympathetic to ISIS, Juraboev was allegedly encouraged to travel abroad to join the fight.

Juraboev and Saidakhmetov had numerous discussions on the logistics of traveling to Turkey and getting across the Syrian border, according to the complaint.

WCBS 880’s Alex Silverman spoke with the manager of Nil Travel Agency, on Coney Island Avenue in Sheepshead Bay, Brooklyn, where the alleged would-be ISIS fighters bought their tickets to Istanbul.

The manager said the two suspects, who were arrested in New York, came in on separate days to buy the tickets. He said they seemed like ordinary people and there was no indication of what they had planned.

“He was totally normal, just like, I mean his wearing clothes, and his behaviors,” he said.

The manager said he has been shaking since he found out he sold tickets to people accused of planning jihad.

As WCBS 880’s Irene Cornell reported, Saidakhmetov reportedly told the informant in the case that the only obstacle to his travel was his mother, who suspected what he was up to and had taken his passport.

“Don’t worry about the [transportation] fare and the expenses needed for going there,” Habibov allegedly told Saidakhmetov. “I promised you that we’ll do it. If you say you need to buy your ticket, then I’ll deposit cash into your account.”

The informant befriended the defendants at a local mosque and recorded conversations about their plans to travel to Syria via Turkey, Papa reported.

Each man faces up to 15 years in prison if convicted.