[What you need to know to start the day: Get New York Today in your inbox.]
Around the anniversary of the Sept. 11 attacks last year, Ashiqul Alam voiced his admiration for their mastermind, Osama bin Laden, and said he wanted to carry on Bin Laden’s legacy of violent extremism, court documents said.
“He did what he is supposed to do,” Mr. Alam, 22, said, according to a criminal complaint. “Now it’s up to us.”
That sentiment, expressed to an undercover law enforcement agent, kicked off a series of conversations about a potential terrorist attack in New York City that ultimately led to Mr. Alam’s arrest on Thursday, the authorities said.
Mr. Alam, a green-card holder from Bangladesh who lives in Queens, was taken into custody after trying to buy two Glock pistols with defaced serial numbers from an undercover officer, officials said.
His arrest was the culmination of months of work involving three undercover agents and several law enforcement agencies, which had begun monitoring him last August, the authorities said.
In meetings with undercover agents over 10 months, Mr. Alam discussed the possibility of carrying out suicide bombings in Washington or in Times Square. He said he wanted to kill a government official, shoot police officers with AR-15 assault rifles and fire a rocket launcher at the new World Trade Center, the criminal complaint said.
Despite his intentions, he posed no immediate threat, officials said. The whole time, law enforcement was “monitoring his plans and intervening to prevent those plans from escalating into deadly violence,” Richard P. Donoghue, the United States attorney for the Eastern District of New York, said in a statement.
Two law enforcement officials, who asked that their names not be published because they were not authorized to discuss the case, characterized Mr. Alam’s statements as “aspirational.”
Mr. Alam was formally charged Friday in Federal District Court in Brooklyn with purchasing firearms with obliterated serial numbers. He was not charged with terrorism-related crimes.
He was quiet during his court hearing while his lawyer, James Darrow, asked for his client’s release on bail.
“He has two jobs and is a student,” Mr. Darrow said. “He’d like to continue to do that.”
Magistrate Judge Cheryl L. Pollak ordered him permanently detained, citing the seriousness of the accusations and calling him a “danger to the community.”
The investigation of Mr. Alam began last August, when he met with an undercover agent, the complaint said. Between the initial meeting and his arrest, he repeatedly stated his interest in buying weapons and explosives for a terrorist attack in New York City. He also expressed his admiration for terrorist groups, including ISIS and Al Qaeda, the complaint said.
Last September, for instance, he told an undercover agent that Bin Laden’s violent, extremist mission during the Sept. 11 attacks was “a complete success,” according to the complaint.
Accompanied by an undercover agent, he conducted several “recon” trips to Times Square, using his cellphone to make recordings of the area while scouting potential targets, the complaint said.
The reconnaissance was crucial, Mr. Alam told agents, because he would need to be prepared, the complaint said. “Like in a war,” he explained.
In January, while traveling to a shooting range, Mr. Alam told an undercover agent that he wanted “to die fighting,” according to the complaint. On their return trip, he said he wanted to buy a gun.
The same month, he said he would likely use that gun in an attack on Times Square, pointing specifically to Duffy Square, where tourists congregate around a red staircase and the TKTS booth, the complaint said.
In subsequent meetings, Mr. Alam continued to tell the agent that he wanted to purchase firearms, officials said.
At one point, in March, an undercover agent asked Mr. Alam what would make him happy, the complaint said. Mr. Alam responded, “Seeing the flag of Islam on the Twin Towers or the Empire State Building.”
The next month, Mr. Alam said he was getting Lasik eye surgery, justifying the procedure by referencing his hypothetical attack, according to the complaint.
“Let’s say we are in an attack, right, say that my glasses fall off,” he said to an undercover agent. “What if I accidentally shoot you?”
“Imagine what the news channel would call me,” he added. “The ‘Looney Tunes Terrorist’ or the ‘Blind Terrorist.’”
Mr. Alam’s neighbors in the branching, seven-story apartment complex he called home in the Jackson Heights neighborhood in Queens, described him as a standoffish young man who tried to project a powerful image.
Mohammed Islam, 18, said one thing that stuck out about Mr. Alam was his walk — a macho strut that projected aggression.
Otherwise, Mr. Alam was “very quiet,” Mr. Islam said. “Every time I saw him he was alone.”
Mr. Islam said he saw between 10 and 15 federal agents go into Mr. Alam’s fifth-floor apartment on Thursday. They were carrying guns and wearing vests, he said.
The agents came in and out of Mr. Alam’s apartment for around three hours, Mr. Islam said.
The bustling, tourist-clogged area around Times Square in Midtown Manhattan has been the site of several attempted attacks in recent years.
In 2017, a man detonated a pipe bomb in the crowded subway corridor that connects the busy Port Authority Bus Terminal to Times Square. The bomb blast terrified commuters but the only person seriously injured was the person who planted it.
The bomber, Akayed Ullah, who said he was inspired by the Islamic State, was found guilty of federal terrorism charges last year.
Months prior, in May, a different man plowed his car into Times Square’s crowded sidewalks, killing an 18-year-old woman and injuring 20 other people.
The driver, Richard Rojas, was charged with murder and attempted murder. He told a police officer that he had smoked marijuana laced with PCP, or angel dust, on the day of the deadly rampage, according to the criminal complaint against him.
In 2010, an attempted car-bombing in Times Square was stopped when a sidewalk vendor saw smoke coming out of an S.U.V. and called the police. The car, parked near Broadway, was packed with gasoline, propane, fireworks and fertilizer.
The police took the would-be bomber, Faisal Shahzad, into custody at Kennedy Airport, where he had boarded a flight to Dubai.
Mr. Shahzad pleaded guilty to terrorism charges in the case and was sentenced to life in prison, after telling court he was a “proud” terrorist.
Nate Schweber and John Surico contributed reporting.