Jarrod Warren Ramos, the suspect in what police called a “targeted attack” on the Annapolis, Maryland, newspaper, has been charged with five counts of first-degree murder, according to court records.

Ramos, 38, is scheduled to have a bail hearing at 10:30 a.m. ET Friday in Annapolis.

On Thursday afternoon, a gunman entered the building where the Capital Gazette is housed, armed with a shotgun and smoke grenades and opened fire, police said. The suspect was found hiding under a desk in the building, Anne Arundel County Executive Steven Schuh told CNN. He was taken into police custody and was being interviewed Thursday night by criminal investigators, said William Krampf, acting chief of the Anne Arundel County police.

“It’s clear that (Ramos) had a longstanding grievance against the Capital (Gazette) and various individuals who worked there, resulting from reporting that they had done,” leading to a 2012 defamation lawsuit that was later dismissed, Schuh told CNN on Friday morning.

The five slain were Gerald Fischman, 61, editorial page editor; Rob Hiaasen, 59, an assistant editor; John McNamara, 56, a staff writer; Rebecca Smith, 34, a sales assistant; and Wendi Winters, 65, who worked in special publications.

Capital Gazette: ‘Yes, we’re putting out a damn paper’

Hours after the shooting, the Capital Gazette, a newsroom in mourning, published a newspaper with a front page bearing the photos of the five employees who were killed.

“We are heartbroken, devastated. Our colleagues and friends are gone. No matter how deep our loss is nothing compared to the grief our friends’ families are feeling,” Capital editor Rick Hutzell was quoted in the paper’s front-page story.

The gunman fired through the glass door of the newsroom, Phil Davis, a Capital Gazettepolice reporter, tweeted shortly after the shooting. “There is nothing more terrifying than hearing multiple people get shot while you’re under your desk and then hear the gunman reload,” Davis wrote.

The newspaper, which was reeling from the attack, defiantly tweeted on Thursday: “Yes, we’re putting out a damn paper tomorrow.”

Several staffers and reporters from sister paper The Baltimore Sun worked on stories for Friday’s paper.

The opinion page in Friday’s paper was left mostly blank with a brief message: “Today, we are speechless. This page is intentionally left blank today to commemorate victims of Thursday’s shootings at our office.”

It listed the five victims’ names.

“Tomorrow this page will return to its steady purpose of offering our readers informed opinion about the world around them, that they might be better citizens.”

‘His intent was to cause harm’

Two law enforcement sources said Ramos’ fingerprints appear to have been altered, making it difficult to identify him that way. He was identified using facial recognition software, according to one law enforcement source.

Court documents showed that Ramos had filed a defamation claim against the paper in 2012. The dispute was over an article in the Capital Gazette that detailed his guilty plea in a 2011 harassment case.

Titled “Jarrod wants to be your friend,” the story was written by staff writer Eric Hartley and detailed the case where Ramos repeatedly contacted a former high school classmate via Facebook, according to court documents.

Court records show that in July 2012, Ramos filed a complaint against Hartley and the newspaper, alleging the story defamed him. The case was eventually dismissed.

A Twitter account with Ramos’ name and the handle @EricHartleyFrnd is believed to belong to Ramos, a law enforcement source said.

The account had tweeted several times about the paper and Hartley. By Friday morning, the account was suspended.

The Capital Gazette had been threatened on social media with violence as recently as Thursday, Krampf said, without saying who was behind those threats. “This was a targeted attack on the Capital Gazette,” he said.

Krampf said police didn’t have knowledge that the gunman was targeting anyone in particular and can’t confirm whether the suspect knew employees at the paper or just targeted the publication.

“This person was prepared to shoot people. His intent was to cause harm,” he said.

Schuh, the Anne Arundel county executive, said Friday morning that Ramos was not cooperating with investigators. He said the suspect had given no specific warning he was going to attack the newspaper.

“I don’t believe there’s any indication that this was anything more than a personal grievance from this individual directed toward the newspaper and its employees,” Schuh said.

A newsroom and a community mourn

Journalists at the newspaper tweeted tributes and memories of their colleagues.

“The Capital is not a big newsroom. There are about 20 news staffers, a few more advertising. We are close. We are family. I am devastated,” reporter Danielle Ohl tweeted.

In a Facebook post, best-selling author and Miami Herald columnist Carl Hiaasen said he was “devastated and heartsick” to confirm the death of his brother, Rob Hiaasen, affectionately known as “Big Rob” because he towered over people.

“He spent his whole gifted career as a journalist, and he believed profoundly in the craft and mission of serving the public’s right to know the news,” Carl Hiaasen wrote.

A vigil for the victims will be held at 8 p.m. Friday at the Annapolis City Dock, city officials said.