(CNN) A man who investigators allege was plotting to kill people in New York's Times Square is being held on weapons charges, accused of buying two illegal pistols from an undercover government agent, federal prosecutors said Friday.

Ashiqul Alam, 22, of Queens, was charged in a federal court in Brooklyn with knowingly receiving two firearms with obliterated serial numbers, a criminal complaint reads. He is being held without bail.

Alam briefly appeared in Brooklyn federak court Friday for his arraignment, wearing a purple T-shirt, jeans and red and black sneakers. His attorney proposed a bail package that included a $200,000 secured bond to be signed by Alam's parents, who were also in the courtroom. A federal prosecutor argued that there was no condition that would be appropriate, saying "the nature and circumstances of this offense are extremely serious."

A magistrate judge denied bail, noting that Alam poses a danger to the community and is a flight risk.

Alam, a Bangladeshi citizen and lawful permanent US resident, was taken into custody Thursday after giving an undercover agent a total of $800 for two pistols that had the manufacturers' serial number scratched off, the complaint alleges.

Read More