A Queens man was charged Friday with buying illegal guns as part of an alleged plot to carry out a terrorist attack in New York City’s Times Square.

Ashiqul Alam, 22 years old, was arrested Thursday afternoon as the result of an elaborate law-enforcement surveillance operation. Mr. Alam, a Bangladeshi citizen who is in the U.S. legally, had a nearly yearlong relationship with an undercover agent with whom he believed he was planning a terrorist attack, according to a criminal complaint unsealed Friday in federal court in Brooklyn.

...