Carl Hiaasen — a longtime columnist for The Miami Herald — said that he had no information about what had transpired, but that his family was “devastated beyond words.”

“He was dedicated to journalism. He spent his whole life as a journalist,” he said.

President Trump said on Twitter that he had been briefed on Thursday’s shooting. “My thoughts and prayers are with the victims and their families,” he said. His spokeswoman, Sarah Huckabee Sanders, tweeted later: “Strongly condemn the evil act of senseless violence in Annapolis, MD. A violent attack on innocent journalists doing their job is an attack on every American.”

Past and present employees of the newspaper chain were struggling to understand what could have prompted such an attack.

“The Capital, like all newspapers, angered people every day in its pursuit of the news,” Mr. Marquardt wrote on Facebook. “In my day, people protested by writing letters to the editor; today it’s through the barrel of a gun. Sure, I had death threats and the paper had bomb threats. But we shrugged them off as part of the business we were in.”

The New York Police Department said its decision to deploy officers to news organizations was not based on any specific threat, “but rather out of an abundance of caution until we learn more about the suspect and motives behind the Maryland shooting.” The department described such deployments as “a standard practice to shift resources strategically during active shooter or terrorist events.”