(CNN) The accused gunman in the deadly shooting at Maryland's Capital Gazette newspaper barricaded the back entrance of the paper's office so people could not escape as he began "systematically hunting and killing," Anne Arundel County State's Attorney Wes Adams said Friday.

Authorities said Jarrod Warren Ramos, 38, stormed into the paper's Annapolis newsroom Thursday afternoon with a shotgun, killing five employees and leaving two others wounded -- with the shooting taking place a few years after he unsuccessfully sued the newspaper for defamation

Ramos concealed his weapon as he entered the building's back entrance and barricaded a back door, Adams said at Ramos' bail hearing Friday morning in an Annapolis court. The first blasts came through the building's front door, which sent employees rushing toward the back door.

Ramos shot at least one victim who was trying to escape through the barricaded door, Adams said.

"This fellow was there to kill as many people as he could get," Anne Arundel County police Chief Timothy Altomare said at a news conference Friday in Annapolis.

Police said that Ramos was arrested shortly after the shooting and that responding officers found him hiding under a desk. He has been charged with five counts of first-degree murder, according to court records.

JUST WATCHED Wife: We planned to open birthday gift tonight Replay More Videos ... MUST WATCH Wife: We planned to open birthday gift tonight 01:02

A judge ordered Ramos held without bail at Friday's hearing.

Ramos, wearing a dark shirt, appeared in court via a video feed from a nearby detention center, standing silently as Adams made the allegations against him.

Ramos had a plan to escape, but it was thwarted when police responded, Adams said.

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.

The two wounded employees, Rachel Pacella and Janet Cooley, have been treated at a hospital and released, Anne Arundel police Lt. Ryan Frashure said.

'Never stop reporting'

At a vigil Friday in Annapolis, mourners held candles and copies of the Capital Gazette. Some held each other during the walk.

One woman carried a sign that said, "Never Stop Reporting," and "We Need Your Voice & Stories." At one-point, people lined both sides of one street as a musician, who stood in the middle of the street, played "Amazing Grace" on a bagpipe. Some people sang the words to the hymn.

Carol Geithner, left, and Yasemin Jamison gather for a candlelight vigil in Annapolis, Maryland.

'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 slain employees.

"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 said in the front-page story.

The gunman fired through the newsroom's glass door, Phil Davis, a Capital Gazette police 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 its 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."

Tomorrow this Capital page will return to its steady purpose of offering readers informed opinion about the world around them. But today, we are speechless. pic.twitter.com/5HzKN2IW7Q — Capital Gazette (@capgaznews) June 29, 2018

The defamation lawsuit

Suspect Jarrod Ramos sued the paper for defamation in 2012.

Ramos used a 12-gauge pump-action shotgun -- which he legally bought about a year ago -- to shoot and kill his victims, said Altomare, the county police chief. Police also have said Ramos had smoke grenades.

Police said they haven't determined a motive, noting the suspect hasn't cooperated with investigators. But they have said Ramos made threats against the paper a few years ago on social media and noted that he sued the publication six years ago.

"This was a targeted attack," Altomare said Friday.

Court documents show Ramos filed a defamation suit against the paper and a reporter in July 2012. The dispute was over an article that detailed Ramos' 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.

The case was eventually dismissed.

Brennan McCarthy, an attorney for the woman in the harassment case, told CNN that Ramos took information she shared with him in confidence "and then used those confidential facts and (took) them to an illogical end."

Ramos sent a letter to the woman's employer saying she was a bipolar drunkard, which led to her being fired, the attorney said.

"They never had a romantic relationship at all and I don't think that he ever really wanted a romantic relationship, "McCarthy said. "This was malevolence."

"He had an issue with this woman. I don't know what it was but he did everything he could to destroy her life," he said.

Ramos posted veiled threats on social media and also turned his attention to McCarthy, re-posting McCarthy's Facebook posts on social media, the attorney said.

"This is a man that actually stalked the attorney for the stalking victim," McCarthy said

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.

Police: Paper decided not to pursue charges in 2013

Altomare said his department investigated threatening online comments that Ramos allegedly made against the paper in 2013.

But in a conference call between a detective and the paper's legal team that year, the Capital Gazette decided not to pursue charges because of fears it would exacerbate the situation, Altomare said.

In a 2013 police report, an Anne Arundel officer wrote that during that call, "I indicated that I did not believe Mr. Ramos was a threat" to the Capital's employees.

"This was based on the contact they have had with him, as only on Twitter and civil court filings. He has not attempted to enter the Capital newspaper building or sent direct threatening correspondence," the officer wrote.

The threatening tweets included "mention of blood in the water, journalist hell, hit man (and) open season," the officer wrote.

The officer describes the comments as "fringe" and "ranting," the report said.

Tom Marquardt, the Capital Gazette's former editor and publisher, told CNN on Friday he was disappointed charges were not filed.

"In my mind, a layman's mind, all I saw was a threat against my life and a threat against people who working for me," Marquardt said. "They felt however, in their professional opinion, that the evidence wasn't there."

"Once we sensed something was amiss here, we took the precautionary role of making sure that the staff was aware of what was happening. ... We gave them a photo of Mr. Ramos in case he would enter the newsroom," Marquardt said, referring to when the paper was housed in a different building.

He added: "Also we had a given a photo to the front desk, with my personal instruction, that if anybody that resembled him would come through the door that they were to call 911 and our own security."

The Capital Gazette had been threatened on social media with violence as recently as Thursday, police have said, without detailing who was behind those threats.

Anne Arundel County Executive Steven Schuh said Friday Ramos gave 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.

Suspect fired by an employer for "security suitability concerns"

In July 2014, Ramos was fired by his previous employer, Enterprise Information Services, where he worked as a help desk specialist within the Bureau of Labor Statistics in Washington, according to court documents.

Ramos sued, saying they still owed him money, and wrote in a letter, "No misconduct was ever cited to me and I received no explanation beyond 'suitability concern." Ramos said he spoke with his supervisor who told him "something has come to light," but the supervisor did not explain what the issue was.

Enterprise Information Services filed a response to Ramos' complaint, saying the federal government demanded he be terminated "citing security suitability concerns resulting from an Investigation conducted by the Office of Inspector General."

The company said it was "never informed of the exact nature of the investigation."

An email from bureau employee informed her co-workers then that Ramos would not be allowed on the premises "in order to mitigate potential security risk."

Neither Enterprise Information Services nor the bureau immediately responded to a request for comment on the nature of Ramos' termination.

Identified through facial recognition technology

Surveillance recordings from inside the building Thursday show Ramos and the shootings, police said in a probable cause affidavit.

Altomare said police identified Ramos through facial recognition technology, using stored images -- perhaps such as driver's license photos -- from the Maryland Image Repository System.

Police did so after they had difficulty identifying Ramos through fingerprints, Altomare said.

Altomare said that earlier reports about Ramos' fingerprints having been mutilated or altered were incorrect. CNN previously reported from two law enforcement sources that the suspect's fingerprints appeared to have been altered.

Investigators have found evidence at Ramos' Laurel apartment -- about a 30-minute drive from Annapolis -- showing "the origination of planning" for the shooting.

Altomare didn't detail the discoveries, other than saying the findings show "what we knew we would find, which is we have one bad guy."

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.

Clarification: This story has been updated to reflect new reporting from police regarding the suspect's fingerprints.