Tarek Mehanna grew up in Boston's upscale suburbs, earned a doctorate in pharmacology, taught religion and math at a Muslim middle school and was considered a typical American kid by those who knew him. Yet Mehanna, who had Egyptian and U.S. citizenship, told a friend he felt out of place in America, according to documents filed in court. And prosecutors say he used his hostility toward this country in a plot to kill U.S. troops in Iraq, assassinate top politicians and shoot down shoppers in U.S. malls.

Mehanna, 27, was arrested early Wednesday at his parents' home in Sudbury, an affluent town around 20 miles west of Boston. He was charged with conspiring with two others — Ahmad Abousamra, an American now in Syria, and an unidentified man who is cooperating with authorities — to support terrorism.

Ultimately, the trio never came close to pulling off an attack. Authorities say they never got the terrorist training they sought. The men told friends they were turned down because of their nationality, ethnicity or inexperience, or that the people they'd hoped would get them into such camps were either in jail or on a religious pilgrimage.

They abandoned the mall attack plans after their weapons contact said he could find only handguns, not automatic weapons, authorities said.

Mehanna's friends were shocked to see him depicted him as a would-be terrorist.

"He's not going to go crazy in a mall. There's no way he would do something like that," said Rola Yaghmour, 20, of Shrewsbury. "I read it and I was laughing, and I was like, 'They have to be kidding.' Because there's no way he would do something like that. It makes no sense."

Dr. Abdul Cader Asmal, a family friend who was president of the Islamic Center of Boston in Wayland when Mehanna was a middle school student attending weekly religious education classes, remembered him because they shared an interest in Superman. He said Mehanna would bring comics to show in class.

"He looked like a fun-loving, ordinary, typical American kid," said Asmal, an internist at Massachusetts General Hospital. "Certainly there was no hint at all that there was anything at all that would go awry in his behavior at that point."

Mehanna, who has taught math and religion at Alhuda Academy in Worcester, made a defiant appearance in federal court Wednesday. He refused at first to stand when the charge of conspiring to support terrorism was read against him but finally stood — tossing his chair loudly to the floor — after his father urged him to do so.

"This really, really is a show," said his father, Ahmed Mehanna, a professor at the Massachusetts College of Pharmacy, where his son earned a doctorate in 2008. When asked if he believed the charges after his son was led away in handcuffs, he said, "No, definitely not."

According to authorities, a friend of Mehanna's who is cooperating with the investigation but is not accused of participating in the alleged plot said Mehanna told him it was "unfathomable" that the United States has military bases in the "heart of the Muslim world" and that the "land of Mohammad ... is being used as a military base to attack Muslims."

Mehanna also told the friend that in the United States he feels "like a fish out of water," according to an affidavit filed in court.

Prosecutors say Mehanna and his friends used code words such as "peanut butter and jelly" for fighting in Somalia and "culinary school" for terrorist camps, and talked extensively of their desire to "die on the battlefield."

He was allegedly part of a conspiracy between 2001 and 2008 that intended to "kill, kidnap, maim or injure" soldiers and two politicians who were members of the executive branch but are no longer in office. Authorities refused to identify the politicians, who they said were never in danger.

Acting U.S. Attorney Michael Loucks said the men justified the planned attacks on malls because U.S. civilians pay taxes to support the government and are "nonbelievers," Loucks said. He refused to identify the targeted malls.

"I'm confident that the American people will put aside their fears and instead rely on the fairness guaranteed by our Constitution," said Mehanna's attorney, J.W. Carney Jr. "Mr. Mehanna is entitled to that."

Mehanna first was arrested in November and charged with lying to the FBI in December 2006 when asked the whereabouts of Daniel Maldonado, who is now serving a 10-year prison sentence for training with al-Qaida to overthrow the Somali government.

Authorities said Wednesday that Mehanna and the other alleged conspirators had contacted Maldonado about getting automatic weapons for their planned mall attacks, but he told them he could only get handguns.

Court documents filed by the government say that in 2002, Abousamra became frustrated after repeatedly being rejected to join terror groups in Pakistan — first Lashkar e Tayyiba, then the Taliban.

"Because Abousamra was an Arab (not Pakistani) the LeT camp would not accept him, and because of Abousamra's lack of experience, the Taliban camp would not accept him," Williams wrote in the affidavit.

Mehanna and Abousamra traveled to Yemen in 2004 in an attempt to join a terrorist training camp, according to court documents.

Mehanna allegedly told a friend, the third conspirator who is now cooperating with authorities, that their trip was a failure because they were unable to reach people affiliated with the camps.

Abousamra said a terror group rejected him when he sought training in Iraq because he was American, according to authorities.