BOSTON - A Massachusetts man accused of plotting to kill Americans was portrayed by federal prosecutors Thursday as a jihadist who is too dangerous to be released on bail, but the man's lawyer said he was charged only after he refused to become an FBI informant against Muslims.

Tarek Mehanna, 27, of Sudbury, was arrested a year ago and charged with lying to the FBI. New, more serious charges were added last month, when Mehanna was accused of conspiring with two other men to shoot shoppers at U.S. malls, to kill two unnamed prominent U.S. politicians and to kill American soldiers in Iraq.

Mehanna earlier pleaded not guilty to the charge of lying to the FBI. On Thursday, he pleaded not guilty to the new charges.

Authorities said he and the other men never came close to pulling off an attack, but did seek training at terrorist camps in the Middle East. The men allegedly told friends they were turned down for terrorist training because of their nationality, ethnicity or inexperience, or that they were unable to make contact with people they hoped would get them into such camps.

The men abandoned plans to attack malls because their weapons contact said he could find only handguns, not automatic weapons, prosecutors allege.

During a detention hearing in federal court on Thursday, Magistrate Judge Leo Sorokin heard arguments from prosecutors and Mehanna's defence on whether he should be kept behind bars until his trial. Sorokin did not immediately rule.

Assistant U.S. Attorney Aloke Chakravarty urged the judge to hold Mehanna without bail, saying he poses a danger to the community and is likely to flee before his trial because he faces a possible sentence of life in prison.

Chakravarty said Mehanna had "radicalized himself" over the last decade, travelling to Yemen to seek training in a terrorist camp and supporting al-Qaida and other terrorist organizations by translating and distributing videos and textbooks intended to encourage others to participate in violent jihad.

Chakravarty said that Mehanna got together with friends who shared similar radical views and watched videos of Americans being beheaded overseas.

"This is someone who enjoyed that," he said.

He also said Mehanna has studied terrorists, including the Sept. 11 hijackers.

Mehanna's lawyer, J.W. Carney Jr., asked that he be released to home confinement while awaiting trial. He pointed to a group of more than 100 supporters who came to the hearing to support Mehanna. Most of them could not fit in the courtroom and had to wait outside.

Among Mehanna's supporters were about a half dozen seventh-grade students he recently taught at a Muslim school in Worcester. Carney said the students, who declined to talk to reporters, submitted letters to the court describing how, during the religion classes he teaches, Mehanna "always says nonviolence is the way to go."

Carney said prosecutors have built their case against Mehanna based on anti-American statements he made between 2002 and 2006, when he was a college student. He said the statements, though unpopular, are protected by the First Amendment.

"Their focus on postings he made or emails is the heart of the government's case," Carney said.

Carney said the FBI twice approached Mehanna in 2007 and urged him "to become a co-operating informant against individuals in the Muslim community."

Carney said FBI agents made a third attempt in 2008, when they spoke with him about charging him with lying in 2006 about the whereabouts of Daniel Maldonado, who is now serving a 10-year prison sentence for training with al-Qaida to overthrow the Somali government. The FBI "said he would be charged with a crime if he did not co-operate," Carney said.

Gail Marcinkiewicz, a spokeswoman for the Boston office of the FBI, declined to comment on Carney's claims.