Five people have been killed and several others were “gravely injured” in a shooting at a newspaper in Maryland, police said.

Anne Arundel County Acting Police Chief William Krampf confirmed the deaths at a news conference.

Governor Larry Hogan previously said that there were “several fatalities and several people in the hospital” following the shooting at the Capital Gazette newspaper in Annapolis.

Phil Davis, a journalist at the newspaper, tweeted that a gunman shot through the office’s glass door.

In his tweet he said: “There is nothing more terrifying than hearing multiple people get shot while you’re under your desk and then hear the gunman reload.”

On TV reports, people could be seen leaving the building with their hands up, as police officers urged them to depart through a car park and officers converged on the building.

Lieutenant Ryan Frashure of Anne Arundel County Police said “we did have” an active shooter in the building, but added that it was now secure.

A spokeswoman for the city of Annapolis said a suspect was in custody.

A US official briefed on the investigation identified the suspect as a white male who is believed to have carried a shotgun.

The official told The Associated Press that the suspect is not co-operating with investigators.

The New York Police Department deployed counter-terrorism teams to news media organisations in response to the shooting.

Deputy Commissioner for Counter-terrorism and Intelligence John Miller said the deployments are not based on any specific threat information, but out of an abundance of caution.

Maryland police officers
Maryland police officers patrol the area after the shooting (Jose Luis Magana/AP)

He said the NYPD is monitoring the shooting.

Police presence was seen outside The New York Times, ABC News and Fox News early on Thursday evening.