BALTIMORE (TNS) — The 38-year-old Laurel man who gunned down five employees of the Capital Gazette in Annapolis used a pump-action shotgun purchased legally, and had barricaded the exit doors as part of a pre-planned attack, authorities said Friday.

Jarrod Warren Ramos made his first appearance in court since being charged with first-degree murder in the targeted attack, staring impassively and blinking at the camera as he appeared over video link from the county jail.

Years after unsuccessfully suing the newspaper for defamation, Ramos blasted through the doors of the newspaper offices Thursday afternoon and hid under a desk where police found him, according to charging documents.

Ramos is charged in the killings of editor and columnist Rob Hiaasen, 59; Wendi Winters, 65, a community correspondent who headed special publications; editorial page editor Gerald Fischman, 61; sports writer John McNamara, 56; and Rebecca Smith, 34, a sales assistant. Two other staff members, Rachael Pacella and Janel Cooley, were also injured during the attack. They have been released from the hospital.

Anne Arundel County Police Chief Timothy Altomare said at a Friday morning news conference that police found evidence of planning at the gunman's apartment.

State's Attorney Wes Adams said that Ramos led a "coordinated attack" that included barricading the back door of the building.

"The fellow was there to kill as many people as possible," Altomare said.

The suspect did not cooperate with police, and Altomare confirmed that authorities used facial recognition technology, drawing from the Maryland Image Repository System, to identify Ramos.

Ramos wore a dark scrub-style shirt at his bail review hearing and was ordered held without bail by a district court judge. "There is a certain likelihood you are a danger," Judge Thomas Pryal said.

Anne Arundel's top public defender, William Davis, represented Ramos at the bail hearing. He argued against holding the hearing and he asked for a gag order in the case. The judge denied both of those motions. Adams argued to keep Ramos in jail, not just because he is charged with five murders, but also due to the nature of the crimes.

Outside of the courthouse, Adams elaborated on Ramos' actions at the newspaper office.

"There were two entrances to the offices in which this attack occurred. The rear door was barricaded. Mr. Ramos then, as I told the judge, entered the front door and made his way through the office where he was shooting victims as he walked through the office."

Windows at the gunman's basement apartment were boarded up by early Friday morning and a large dent marked the blue door. Ramos' name was scrawled on a green slip of paper on the mailbox for 402B.

Residents of the building declined to comment and a property manager called Laurel Police to help clear news reporters from the apartment complex's parking lot about 9:30 a.m., just as more reporters arrived on the scene.

To help piece together the details of how the shooting rampage unfolded, police used surveillance video from the office at 888 Bestgate Road.

The attack began about 2:40 p.m. when 170 people were working inside the 5,000-square-foot office complex. The Capital Gazette, which is owned by The Baltimore Sun, is one of 30 tenants in the building and one of a handful on the first floor.

Reporters who witnessed the shooting said they dove under their desk for protection, some said they tried not to breathe or make any sounds, some screamed and others pleaded for help on Twitter. Police said they arrived within 60 seconds, and surrounded the shooter.

A gunman blasted his way into the Capital Gazette newsroom in Annapolis with a shotgun Thursday afternoon, killing five people and injuring two others, authorities said.

Photographer Paul Gillespie said, "I kept thinking, 'I can't believe I'm going to die. I can't believe this.'"

He made it out alive, describing running during a lull in the gunfire and jumping over his co-worker's body and escaping the building. Gillespie said he made it to a nearby bank and screamed for people to call the police.

Ramos' long grudge with the Capital Gazette began in July 2011 after the paper ran a column about him harassing a former high school classmate on social media and the criminal case against him. He sued the columnist and the organization's editor and publisher for damaging his reputation, but a court ruled in the newspaper's favor and Ramos ultimately lost an appeal.

Neither the columnist, Eric Hartley, nor the editor and publisher, Thomas Marquardt, are still employed by the Capital Gazette. They were not present during the shootings.

President Donald Trump addressed Thursday's "horrific shooting."

"This attack shocked the conscience of our nation and filled our hearts with grief," Trump said from the White House Friday. "Journalists, like all Americans, should be free from the fear of being violently attacked while doing their jobs."

The Baltimore Sun's Yvonne Wenger, Kevin Rector and Nicholas Bogel-Burroughs contributed to this report