Several people have been killed in a shooting in a Jehovah's Witnesses church in Hamburg, with the gunman believed to be among the dead found in the building, German police have said.

A perpetrator may be among the dead, police said. Several people were seriously injured, police said, declining to say how many died.

Hamburg police tweeted that they believed a dead person they had found could be a perpetrator.

"In order to rule out the involvement of further perpetrators, we are conducting comprehensive checks and searches," they said.

Shots rang out at the church in the Grossborstel area, with the first emergency made at around 9.15pm local time, a police spokesman at the scene said. declining to say how many died.

There were no indications that a perpetrator was on the run, a police spokesperson said.

Police alerted people to an "extreme danger" in the area using a catastrophe warning app.

Residents must stay indoors and avoid the area, police said, adding that streets surrounding the church have been cordoned off.

Police officers gather at the scene of the shooting

Several German national media said at least seven people were killed and at least eight injured.

Officers were able to access the site quickly after distress calls came in, a spokesman said.

The first police at the scene found several lifeless bodies and seriously wounded people.

They also heard a shot in the "upper part of the building" before finding a person in the area where it rang out.

"We have no indications of a perpetrator on the run," said the police spokesman.

Instead, officers have "indications that a perpetrator may have been in the building and may be even among the dead."

The spokesman added that the person uncovered in the upper part of the building was "possibly" the perpetrator.

The port city state's mayor Peter Tschentscher expressed shock at the shooting on Twitter.

Sending his sympathies to the families of the victims, he said the emergency services were doing their utmost to clarify the circumstances.