Three years after Jarrod Ramos’s deadly, calculated rampage at the Capital Gazette newsroom, the family and friends of the five people he killed huddled together in an Annapolis courtroom Thursday afternoon, waiting to hear the 41-year-old’s fate.

They had sat through three weeks of testimony from dueling expert doctors in the man’s sanity trial, and they had relived the horrors of June 28, 2018, when Ramos acted on his years-long grudge against the newsroom and gunned down Gerald Fischman, Rob Hiaasen, John Mc­Namara, Rebecca Smith and Wendi Winters.

Before his sanity trial, Ramos had pleaded guilty to the murders.

Now the jury would decide whether he had the mental and emotional capacity to be held criminally responsible for the mass shooting — and spend his life in prison or a maximum-security psychiatric hospital. The defense had argued that his mental disorders created a delusion that led to the deadly attack. The prosecution disagreed and said he acted out of revenge.

In less than two hours, the jury had arrived at their verdict.

“How do you find the defendant?” the clerk asked the otherwise silent courtroom.

“We found him criminally responsible,” the foreman said.

The victims’ loved ones let out a collective breath.

Paul Gillespie, a Capital Gazette photojournalist who survived the attack, took off his glasses and wiped his eyes. Andrea Chamblee, McNamara’s widow, leaned her head back and looked up. And as the judge polled the jury and they affirmed, one by one, their verdict, the sister of Winters clasped her hands and looked their way.

“Thank you,” she mouthed.

A few feet away, Ramos stared expressionless at the jury.

The coronavirus pandemic and legal back-and-forth had delayed this day many times over. By Thursday, when the Capital Gazette community finally had closure, they said they felt overcome by conflicting emotions: relief that the court battle was over and unsure about what form their grief will take.

“I feel like justice has been done,” Gillespie said. “But I’d rather have Rob, John, Gerald, Rebecca and Wendi here.”

Had the court not rearranged its calendar, opening statements for the case would have started on the third anniversary of Ramos’s deadly rampage. Instead, the trial was delayed one day, and the family, friends and colleagues of those killed spent June 28 remembering those lost — and refusing to use Ramos’s name.

But during the trial, Ramos and his mental health were the focus.

With testimony from their expert doctors, Ramos’s defense attorneys argued that three mental disorders — autism spectrum disorder, obsessive compulsive disorder and delusional disorder — fed his fixation with the Capital Gazette and the Maryland judiciary.

The defense argued that Ramos lived in a delusion that took hold in 2011, when then-columnist Eric Hartley’s article about Ramos’s conviction in a harassment case was published in the Capital Gazette. Over time, as Ramos lost his defamation case against the Capital Gazette and exhausted his appeals, his attorneys said, the delusion came to include the entire newspaper and the Maryland judicial system.

He was convinced, his attorneys argued, that the newspaper, prosecutors and judges in the case had conspired against him. The defense painted him as out of touch with reality, a loner with no close friends or family whose only meaningful relationship was with his cat.

“Mental health is real,” public defender Matthew Connell said during closing arguments Thursday morning. “Jarrod Ramos’s mental health is real.”

The prosecution offered a far different narrative to the jury, casting the gunman as in control of his behavior and eerily intelligent in planning the mass shooting. The attack, Anne Arundel County State’s Attorney Anne Colt Leitess argued, was not a symptom of mental illness but was instead a result of a bruised ego and a fixation on revenge.

Citing the state’s four expert doctors, who diagnosed Ramos with schizotypal and narcissistic personality disorders, Leitess said in her final address to the jury that the 2011 Capital Gazette article about Ramos’s criminal harassment charge constituted a “narcissistic injury.”

When his attempts to correct the column failed, he turned to the courts, and when that failed, Leitess said, he had to get justice himself. Ramos first planned to attack the judges who he thought wronged him, the prosecution said, but then turned to the Capital Gazette — a “soft target.”

To make its case, the state called first responders who arrested Ramos, the doctors who analyzed him and the Capital Gazette employees who narrowly survived the shooting. But at the center of their argument was Sameer Patel, the court-appointed forensic psychiatrist who evaluated Ramos a year after the attack. He was the last prosecution witness the jury heard.

The defense had argued in its closing statement that Patel’s testimony was biased, but Leitess said it showed how Ramos was in control of his behavior, understood its criminality and regretted not killing more people in the newsroom that day.

She told the jury that Ramos chose that particular afternoon because there were supposed to be many people in the newsroom. He blocked the exits to trap his victims and set decoys for law enforcement to slow their response. That should prove, Leitess argued, that Ramos was able to control his actions at the time of the shooting.

The state’s attorney went on to tell the jury that Ramos was obsessed with his legacy — and he left “tokens,” as one expert called them, to tell his “story.” A note in the barrel of his shotgun, a card about “survivor’s guilt” to the man who wrote the original Capital Gazette column, a letter to one of the judges in his case, a CD with photos and blueprints Ramos had collected of the newsroom.

The jury, Leitess said, had the power to define Ramos’s true legacy.

“The ending of this story,” Leitess said, “is that a jury found him criminally responsible for his crimes under the laws of this state.”

Two hours later, when the jury returned with the verdict she asked them to find, Leitess did not react until she was in the corridor outside the courtroom, embracing the Capital Gazette community she had come to know, who were huddled in somber celebration.

“It didn’t feel complete until now,” Fischman’s widow choked through tears. Winters’s daughters collapsed into their aunt and sobbed. McNamara’s wife, Chamblee, hugged the others, a “protect journalists” pin on her shirt that touted the “Fourth Estate.”

Leitess addressed them all, acknowledging the pain they had endured to arrive at this verdict. She acknowledged the trauma that the first responders still carry. She praised the testimony of Patel. She expressed gratitude for the bravery of the six survivors who recounted that day for the jury.

Gillespie, wearing a hat with his newsroom’s name, thought about his own relief — and how he’d give anything, he said, to transport back to June 27, 2018, and stay there.

But his thoughts were interrupted by a wave of applause. The jurors, Gillespie realized, had just emerged from the courtroom.

And as they walked by, three reached out and shook his hand.