One suspect is in custody and being interviewed by police, said Lt. Ryan Frashure of the Anne Arundel County Police Department.
One of the newspaper's reporters, Phil Davis, tweeted: "Gunman shot through the glass door to the office and opened fire on multiple employees. Can't say much more and don't want to declare anyone dead, but it's bad." He added that he was safe and was waiting to be interviewed by police.
"There is nothing more terrifying than hearing multiple people get shot while you're under your desk and then hear the gunman reload," he said.
What we know about the shooter
Authorities described the suspect in custody as a white man in his late 30s but said they didn't have information about a possible motive. The Associated Press reported that the man was not cooperating with police.
"At this point, we're still talking to the individual, we're engaging with the individual," Frashure told reporters at a news conference.
Citing local law-enforcement authorities, NBC News and CNN reported that the suspect had "altered" his own fingerprints in an attempt to stall investigators working to identify him. Both news outlets said authorities later learned the suspect's identity through the use of facial-recognition technology.
CNN reporter Even Pérez said the suspect had a previous encounter with an employee at the Capital Gazette. The details of that alleged encounter were not immediately clear.
Authorities also said that a "long gun" was used in the shooting and that no gunfire was exchanged between the gunman and officers.
There were roughly 170 people in the building at the time of the shooting, and most of them were escorted out safely, police said.
The local NBC affiliate WBAL reported that authorities had found a suspicious package and that bomb squads were responding. William Krampf, the deputy police chief, later said the item that they thought was an "explosive device" had "been taken care of."
Agents from the Baltimore division of the federal Bureau of Alcohol, Tobacco, and Firearms also responded to the scene, the agency tweeted.
What we know about the people affected
An intern for the newspaper, Anthony Messenger, tweeted that there was an active shooter and pleaded for help. He later said a colleague had been shot.
The Capital Gazette journalists Joshua McKerrow and Danielle Ohl tweeted that Davis and Messenger were safe, as were several other colleagues, including Chase Cook, Pat Ferguson, Paul Gillespie, Selene San Felice, and Rick Hutzell.
One newsroom employee named Rachael Pacella was taken to the hospital with an injury, Ohl said.
Jimmy DeButts, an editor at the paper, tweeted that he didn't have any information to share but that reporters and editors gave their all each day.
"There are no 40 hour weeks, no big paydays — just a passion for telling stories from our community," he said.
He added: "We are there in times of tragedy. We do our best to share the stories of people, those who make our community better. Please understand, we do all this to serve our community."
Video from the AP showed employees walking out of the building with their hands in the air.
Gov. Larry Hogan said he was "absolutely devastated to learn of this tragedy in Annapolis," adding that he was in contact with officials at the scene.
Sen. Chris Van Hollen of Maryland tweeted that his heart was with the "families, friends, and loved ones of the victims," saying that "we must unite to end the violence."
"Phil, I can't imagine what you and the entire Capital Gazette team are going through right now," he said. "Journalists shouldn't have to fend off bullets in the newsroom while doing their jobs — this is not normal. Stay strong."
President Donald Trump was also briefed on the shooting.
"My thoughts and prayers are with the victims and their families," he tweeted. "Thank you to all of the First Responders who are currently on the scene."