ANNAPOLIS, Md. -- A grand jury has leveled 23 charges against a man accused of killing five people in a mass shooting at a Maryland newsroom. In a news release Friday, Anne Arundel County State's Attorney Wes Adams announced the indictments against Jarrod Ramos in the June 28 attack at the Capital-Gazette office in Annapolis.

Ramos, 38, faces five counts of first-degree murder.

Police said Ramos was swiftly arrested and taken into custody at the Capital Gazette newsroom in Annapolis, where he was caught hiding under a desk.

Get Breaking News Delivered to Your Inbox

"This was a targeted attack on the Capital Gazette," Anne Arundel County acting police chief Bill Krampf said earlier this month. "This person was prepared to shoot people. His intent was to cause harm."

Authorities identified the victims killed in the shooting as 61-year-old Gerald Fischman, 56-year-old John McNamara, 34-year-old Rebecca Smith, 65-year-old Wendi Winter and 59-year-old Rob Hiaasen.

Police said surveillance video recorded the attack, which began with a shotgun blast that shattered the glass entrance to the open newsroom. Journalists crawled under desks and sought other hiding places, describing agonizing minutes of terror as they heard his footsteps and the repeated blasts of the weapon.

Officers swiftly responded and arrested him without firing a shot, police said. They recovered a gun and said he also carried smoke grenades. Some 300 local, state and federal officers converged on the scene, Anne Arundel County Chief Timothy Altomare said.

Ramos had a well-documented history of harassing the paper's journalists, a feud that apparently began over a column about Ramos pleading guilty to harassing a woman. He filed a defamation suit against the paper in 2012 that was thrown out as groundless, and he repeatedly railed against its staff members in profanity-laced tweets.

He also routinely sent profanity-laced tweets about the paper and its writers that retired publisher Tom Marquardt said he called police in 2013, telling his wife at the time, "This guy could really hurt us." A detective spoke with legal counsel for the Capital Gazette and several members of the Capital Gazette staff at the time, but the newspaper didn't wish to pursue criminal charges over "a fear that doing so would exacerbate an already flammable situation," Altomare said.