The high-profile trial began of a man accused of being part of a New York trio that was only "days" from launching suicide bombs in the city's crowded subway to take revenge for the US war in Afghanistan.

The trial in Brooklyn features New York immigrant Muslims who became radicalized in the feverish post-9/11 atmosphere and allegedly became homegrown terrorists with a plan to cause carnage in America's biggest city.

Federal prosecutor James Loonam opened by pointing across the courtroom at defendant Adis Medunjanin, 27, and calling him an Al-Qaeda "terrorist."

Loonam detailed how in September 2009 Medunjanin, along with two former New York high school friends, put final touches on a plan to bomb either the subway, Times Square, or another packed location.

"Three men were prepared to strap bombs to their bodies and walk into crowded New York subway cars that were filled with innocent people," Loonam said. "These men came so close, within days of carrying out this attack, before they were stopped."

Gesturing at Medunjanin, who wore a suit, the prosecutor said: "One of those Al-Qaeda terrorists is inside the courtroom right now."

Medunjanin, a Bosnian whose family fled to the United States during the war with Serbia in the 1990s, is charged with nine terrorism-related counts.

He is accused of traveling to Pakistan in 2008 in a failed attempt to join the Taliban to fight against US forces in Afghanistan, then entering the bomb plot on his return home, and finally trying to use his car to cause bloodshed in a desperate last act before his arrest.

He has pleaded not guilty. His lawyer, Robert Gottlieb, said Medunjanin was only a passionate Muslim who wanted to go toAfghanistan because he was outraged by the US drone bombing of civilians and abuses in US military prisons.

"The truth is Adis Medunjanin is not a terrorist. The truth is, in this case, the government with all its inflammatory and incendiary allegations, is just wrong," Gottlieb said.

"Mr Medunjanin never planned to bomb the New York City subways, contrary to what the government has told you. Mr Medunjanin never joined any plan, as that term is defined in the law... to go to Afghanistan to kill members of the United States military."

The other two men in the alleged plot, Najibullah Zazi and Zarein Ahmedzay, have already pleaded guilty and turned on their old friend in hopes that cooperation with prosecutors will earn them lighter sentences.

Ahmedzay was the first witness called by the prosecution.

He told the court that Medunjanin had helped him grow closer to Islam. Then one day, when the three of them were in a car, they "made a covenant to go to Afghanistan" and join the Taliban.

He described Medunjanin as steadfast in his ambition to become a suicide bomber on return to the United States.

Gottlieb raked Ahmedzay over the coals, suggesting that the admitted terrorist was lying on the witness stand to save his own skin and be free to see his two young children again.

"You would be willing to kill, to set off a bomb, but you wouldn't lie to a jury?" asked Gottlieb sarcastically.

"No," Ahmedzay replied.

Zazi, described as the chief bomb maker, was due to take the stand Tuesday.

Medunjanin could face life in prison if found guilty on all counts.

The trial, which could last three weeks, has already begun to expose the inner workings of America's radicalized Muslim youth in an era of continuous, controversial wars in Iraq and Afghanistan and what many civil rights defenders describe as anti-Islamic discrimination on US streets.

The three friends were in many ways typical New Yorkers, striving to live the immigrant dream. Medunjanin was a doorman, Ahmedzay drove a yellow cab, and Zazi was a coffee cart vendor before moving to Colorado, where he drove an airport shuttle bus in Denver.

Gottlieb said prosecutors were fear mongering to make Medunjanin sound like a monster, to "scare you to your core."

Gottlieb said Medunjanin did not intend to hurt his adopted country, but did hope to support the Taliban guerrillas "to defend Muslims."

But Loonam said the defendant and his two former friends were eager recruits to the al-Qaeda cause and seen as prized assets during their visit to Pakistan.

"They were potentially very valuable to them. They had American passports," he said. "This meant these men could return to the United States undetected."

Back on US soil, all three allegedly worked to put a triple suicide attack together, and had already built the most difficult part of the bombs when Zazi was arrested.

Shortly before, he had emailed his al-Qaeda contact in code to report the successful preparations, saying: "The marriage is ready."