Gunman who killed five at US newspaper sentenced to life in prison
Jarrod Ramos, suspected of killing five people at the offices of the Capital Gazette newspaper office in Annapolis, Maryland, U.S., June 28, 2018 is seen in this Anne Arundel Police Department booking photo provided June 29, 2018. Anne Arundel Police/Handout via REUTERS

A man who shot dead five people at a local US newspaper against which he held a grudge was sentenced Tuesday to life in prison with no possibility of parole.

Armed with a shotgun, Jarrod Ramos burst into the newsroom of the Capital Gazette in Annapolis, Maryland, an hour outside the capital Washington, on June 28, 2018, and killed four journalists and a sales assistant before being arrested.

It was one of the worst attacks on a media outlet in the United States, and sent shock waves through the country.

Charged with murder, Ramos, now 41, pleaded guilty to the killings but said he was insane at the time of the attack and not criminally responsible. But in July a jury ruled that he was in fact criminally responsible.

At Tuesday's sentencing hearing, survivors and relatives of those killed were allowed to speak. Ramos expressed no emotion then or when the sentence was read out, according to journalists who were in the courtroom.

Ramos had a troubled relationship with the Capital Gazette after having unsuccessfully attacked it for defamation and threatened it several times online.

He was furious at the paper for an article published in 2011 entitled "Jarrod wants to be your friend," in which the newspaper recounted the ordeal of a young woman he had harassed on the internet, and which had earned him a 90-day suspended prison sentence.

Ramos spent two years preparing for his attack, scouted out his target and even took out a chess club membership in anticipation of being locked up for years afterward, his lawyer Katy O'Donnell has said.

Ramos suffered from autism spectrum disorders and compulsive and delusional disorders, among other problems, according to O'Donnell.

At Tuesday's sentencing, Judge Michael Wachs said: "The impact of this case is just immense. To my shock, he stated (that) planning this attack were the best years of his life."