A judge on Friday sentenced an 18-year-old Arizona man to eight years in prison for terrorism convictions stemming from a plot to attack a motor vehicle office in metro Phoenix.

Mahin Khan of Tucson previously pleaded guilty to terrorism, conspiracy to commit terrorism, and conspiracy to commit misconduct involving weapons.

His lawyers sought a seven-year sentence, while prosecutors wanted him to spend 14 years in prison.

Prosecutors say Khan wanted to attack the motor vehicle office in Mesa and instructed an undercover FBI employee to start building homemade grenades.

Khan was accused of wanting to inspire an insurgency in the U.S. to carry out the sort of attacks that occurred in Paris and Brussels and had online exchanges with a person believed to be a member of the Islamic State terror group.

Authorities said Khan had also expressed a desire to attack a Jewish community center in Tucson and that investigators found a document in a search of his home that showed he wanted to attack a military recruiting center and a fitness location.

Defense attorney Robert Ditsworth said Khan has struggled with mental health issues and shown poor impulse control but accepts responsibility for his actions.

Khan's friends and family made emotional pleas for leniency, describing him as a lost and confused child. "He knows that the mistake he made was wrong," said Bisma Khan, his cousin.

Prosecutor Blaine Gadow said Khan wasn't being prosecuted for just his words but also for his actions in relaying bomb-making instructions to an undercover FBI employee.

"There has to be a consequence, a price to be paid," Gadow said.

Prosecutors have said the FBI and Khan's parents had taken steps in the past to steer Khan away from his radical viewpoint.

Authorities say the FBI first approached Khan when he was 15 and he later underwent 45 days of mental health treatment for a condition that hasn't been publicly specified.

___

Follow Jacques Billeaud at twitter.com/jacquesbilleaud. His work can be found at http://bigstory.ap.org/content/jacques-billeaud.