OAKLAND -- A bizarre yearlong federal case involving a San Jose man convicted in a doomed FBI-infiltrated plot to blow up an Oakland bank came to a quiet end Thursday with the judge, prosecutor, and defense attorney all agreeing his mental illness was the primary driver of his actions.

In accordance with a plea agreement, 29-year-old Matthew Aaron Llaneza was sentenced to 15 years in federal prison in connection with the Feb. 8, 2013, scheme to detonate a purported bomb at a Bank of America branch on Hegenberger Road.

Llaneza was contrite and cooperative as he was handed his sentence from Judge Yvonne Gonzalez Rogers in an Oakland courtroom.

Matthew Aaron Llaneza
Matthew Aaron Llaneza (San Jose Police Department)

"I do believe that 15 years is sufficient but not greater than necessary to protect the public and punish you for actions that were, by their nature, terrorist," Rogers said.

Llaneza himself spoke at his sentencing, as his father, Steven, sat in the gallery. He appeared earnest as he accepted his fate.

"I would just like to say I sincerely apologize, and I'm sorry for any misconduct on my part," he said, adding that while in prison he will seek help "so I can live a normal life and conduct myself as a law-abiding citizen."

Llaneza, a Mesa, Ariz., native and convert to Islam who moved to San Jose in the past few years, caught the FBI's attention with online jihadist rants that elicited a higher level of concern after his April 2011 assault-weapons arrest and ensuing conviction after a suicidal episode in front of his father's Berryessa home.

He later came into contact with an undercover FBI agent who plotted along with him the bombing scheme, which Llaneza reportedly said would ignite a civil war in the United States. But when the time came to carry it out, he was arrested after trying to use a cellphone to detonate what the FBI had fashioned as a realistic but ultimately inert dummy bomb.

Given his mental illness -- which includes schizophrenia and bipolar disorder -- the case drew strong rebukes from civil rights groups who accused the government of exploiting a man with a fragile grip on reality and manufacturing a threat for the sole means of defusing it.

There was no evading the fact that Llaneza had engaged in a terrorist ploy, even as questions arose about whether he would have been able to pull it off without the FBI's help. But his 15-year sentence -- half the maximum allowed -- reflected an understanding between all parties that Llaneza needed just as much help as he deserved punishment.

"I wish this had gone in a different direction. I wish this had been diagnosed earlier," said assistant federal public defender Jerome Matthews, referring to his client's illness. "Matthew would never hurt anybody consciously. He feels he needs to follow people, and that got him into a great deal of trouble."

Assistant U.S. attorney Andrew Caputo called the case "challenging," acknowledging the influence of Llaneza's mental state and noting Llaneza timed the planned bombing for the early hours of the morning to minimize casualties.

Judge Rogers honored Matthews' request to recommend he be sent to a federal facility near Mesa, where he grew up and attended high school before an aborted attempt at becoming a Marine, which was followed by years of erratic behavior tied to his mental illness and which culminated in the terrorism arrest.

Rogers was both sympathetic and firm about Llaneza's sentence, which will be followed by lifetime parole. And she postulated about one of the larger takeaways from the case.

"One of my concerns is how mental illness is manifesting itself," Rogers said. "Our failure to deal with mental illness is having serious repercussions on us."

Contact Robert Salonga at 408-920-5002. Follow him at Twitter.com/robertsalonga.