By David Schwartz

PHOENIX (Reuters) - An Arizona teenager who the FBI said has professed to be an "American jihadist" was ordered to remain held without bond on Wednesday on charges of plotting to stage an attack with bombs and other weapons on a Phoenix-area state motor vehicle office.

The suspect, Mahin Khan, 18, of Tucson, was charged in a three-count indictment earlier this month with terrorism, conspiracy to commit terrorism and conspiracy to commit misconduct involving weapons.

Jailed since his arrest on July 1, Khan faces a maximum penalty of life in prison if convicted. He pleaded not guilty at his arraignment last week.

Maricopa County Superior Court Judge Sam Myers declared Khan ineligible for bond at the end of a hearing in Phoenix on Wednesday, finding the defendant posed a "substantial danger to the community" if he were released.

The ruling capped two days of testimony by FBI special agent Ben Trentlage, who said Khan first came to the agency's attention when he was 15. At that time, Trentlage said, FBI agents contacted the boy and his family and ended up recommending they seek mental health treatment for him.

Trentlage said the current case stemmed from months of communications between Khan with undercover FBI operatives in which he expressed a desire to carry out "lone jihadist" attacks that would kill hundreds of people in Arizona.

Among potential targets Khan mentioned, Trentlage said, were a Jewish community center and an Air Force recruitment office in Tucson, as well as a pizza parlor.

Khan ultimately decided the Division of Motor Vehicles office was a preferred "soft target," reasoning that relatively light security and crowded conditions there offered the best chance of inflicting high casualties, prosecutors said in court.

Prosecutors previously said Khan sought to obtain weapons such as pipe bombs or pressure cooker bombs for the planned DMV attack in communications with an individual he believed was an Islamic State fighter.

In a probable cause statement filed earlier this month, the FBI said Khan had described himself in an email as an "American jihadist" who supports Islamic State, the militant group that has seized parts of Syria and Iraq and claimed responsibility for deadly bomb and gun attacks in France, Belgium and Bangladesh.

On Wednesday, Trentlage said a search of Khan’s home in Tucson uncovered hand-written attack plans, three pressure cookers and what may have been a crude Molotov cocktail.

(Editing by Steve Gorman and Andrew Hay)