At least one person has been killed and three seriously injured after a gunman opened fire at a nightclub in the German city of Konstanz. Police have ruled out terrorism as a motive for the attack, saying it was preceded by a personal dispute.

The 34-year-old gunman was fatally wounded in an exchange of fire with police and died in the hospital.

The gunman was an Iraqi citizen, according to a police spokesman cited by local broadcaster N-TV, but was not an asylum-seeker. The gunman had lived in the city for 15 years and was known to police.

The gunman “was critically injured in a shootout with police officers as he left the disco, and later succumbed to his wounds in hospital,” police said in a statement.

#BREAKING German police rule out terrorist motive in nightclub shooting — AFP news agency (@AFP) July 30, 2017

The shooting took place in a nightclub called ‘Grey’ on Max-Stromeyer Strasse at around 4:30am, according to local media.

A police officer was wounded during the shootout but his injuries are not life threatening.

Konstanz Police tweeted that there no risk at the scene and that an investigation is underway. Special police forces and a helicopter were deployed to the scene as a precaution in case there was more than one shooter, Konstanz Police say.

Nach Schießerei in Konstanz besteht aktuell keine Gefahr mehr! Die Polizei hat die Ermittlungen aufgenommen. Näheres folgt in Kürze. — Polizei Konstanz (@PolizeiKonstanz) July 30, 2017

“There were injured in the shooting. Visitors could save themselves by escaping into the open or hiding,” a police spokesman said, Bild reports.

Local broadcaster SWR reported witnesses saying that the gunman was armed with an automatic pistol.

Terrified nightclubbers had either fled the building or found a place to hide, said SWR.

A bouncer at the site had sought to stop the attacker, but was himself injured by the man, SWR said.

The shooting comes days after a knife attack left one person dead and several others injured in the northern German city of Hamburg.

READ MORE: 1 killed, multiple injured in Hamburg knife attack – police