The man accused of killing five employees of the Capital Gazette newspaper in Annapolis, Md. last year is pleading not guilty by reason of insanity, his attorneys said Monday.

Lawyers for Jarrod Ramos said that their client "lacked substantial capacity to appreciate the criminality of his conduct" when he opened fire in the paper's newsroom on June 28. Ramos, 39, faces 23 charges in connection with the shooting, including first-degree murder in the deaths of victims Gerald Fischman, Rob Hiaasen, John McNamara, Rebecca Ann Smith and Wendi Winters.

Ramos reportedly had a longtime grudge against the newspaper and had a well-documented history of harassing its journalists. Prosecutors, who are seeking a life sentence without the possibility of parole, say Ramos carefully planned the attack and barricaded the rear exit of the office to prevent people from escaping.

Ramos had initially pleaded not guilty. If he ultimately found not criminally responsible, he could be confined to a mental health prison facility. A November trial has been scheduled.

At a court hearing earlier this month, an attorney for Ramos made several references to his client's "bizarre language" and "bizarre behavior" leading up to the shooting. Attorney William Davis said Ramos had "longstanding" mental health issues and a period of "mental health disturbances." Davis also said a mental health expert has been working with the defense.

CLICK HERE TO GET THE FOX NEWS APP

The state will conduct its own evaluation to determine whether Ramos was not criminally responsible. A doctor independent from the prosecution will write a report with recommendations and that report will then be sent to defense attorneys, prosecutors and the court.

Generally, a judge or jury would consider whether the defendant is not criminally responsible after the trial.

The Associated Press contributed to this report.