PORTLAND — Herbert Jones, the man caught wielding a gun outside Portland High School last spring, was suffering from delusions of grandeur and could not appreciate that what he was doing was wrong, a forensic psychologist testified today in support of Jones’ insanity defense in Cumberland County Superior Court.

Jones is accused of attempted murder, stalking and possession of a firearm on school grounds. He told authorities he was planning on killing a man who is a registered sex offender who he thought was attending an Alcoholics Anonymous meeting in the basement of the First Parish Church.

The basic facts of the case are not in dispute and there is no jury. Instead, Superior Court Justice Robert Crowley will decide the case.

Jones has pleaded not criminally responsible by reason of mental disease or defect, commonly called the insanity defense. His lawyer, Neale Duffett called Charles Robinson, a forensic psychologist, to testify about Jones’ mental state leading up to his arrest and immediately afterward.

Robinson said Jones clearly has a bipolar disorder and was suffering from delusions of grandeur, was experiencing manic episodes and did not have the ability to realize what he was doing was wrong. He felt directed by God and believed he was protecting a young woman with whom he was obsessed.

“This is Rambo the avenger, directed by God, arriving on the scene with the heroine standing by to fall into his arms,” Robinson said.

Assistant Cumberland County Attorney Kate Tierney said Jones methodically planned his crime, buying the guns in advance and then parking at the rear of First Parish Church on the May 18, 2009, intent on shooting a man he described as a pedophile. When Portland Police Officer Stephen Black arrested him, he was relieved that he didn’t have to carry out his plan, she said, an indication he knew it was wrong.

If convicted, Jones would be sentenced to prison. If he is found not criminally responsible, he would be committed to a psychiatric institution for treatment.

The trial is scheduled to resume on Wednesday.

11:09 a.m.

PORTLAND — Herbert Jones, the man who was arrested outside Portland High School with a gun last year, appeared before a judge today arguing that he was not responsibe for his actions due to mental illness.

Jones is charged with attempted murder, stalking and possession of a firearm on school property. He was arrested May 18, 2009, between Portland High School and First Parish Church as he loaded a high-powered rifle. Jones said at the time he planned to kill a registered sex offender who he thought was attending an Alcoholics Anonymous meeting inside the church.

Jones has pleaded not criminally responsible because of mental disease or defect. This morning he waived his right to a jury trial and the case is being heard by Judge Robert Crowley.

As the trial got under way, prosecutors played an audiotape of Jones’ interview with Portland Police detectives that was recorded after his arrest.

During the interview Jones broke down crying several times and said he was very upset about pedophiles assaulting young children. He also said he was bipolar, and described his obsession with a woman who attended the AA meetings.