The Baltimore Sun, which owns the Capital Gazette, said police had also been sent to its headquarters as a precaution.
Aerial video showed people leaving the building with their hands up and a heavy police presence.
Anne Arundel County Police Lt. Ryan Frashure said police were still talking to the suspect and a motive has not been determined.
President Donald Trump has been briefed about the shooting, the White House said. The New York Police Department is sending officers to major news organizations in New York as a precaution, according to a senior police official.
Maryland Gov. Larry Hogan said on Twitter that he was “absolutely devastated to learn of this tragedy in Annapolis.”
Noah Turner, an Annapolis resident, said he was nearby when the shooting occurred and saw two police SWAT vehicles and around 10 police cars heading to the scene. “It’s crazy,” Turner said.
“I’ve never seen so many police cars in my life,” he said. “You would not ever think it would happen here.”
This is a breaking story. Check back for updates.
CORRECTION (June 28, 5:20 p.m. ET): An earlier version of this article misspelled the surname of a police lieutenant for Anne Arundel County. He is Ryan Frashure, not Frazier.