A 34-year-old man opened fire in a nightclub in the southern German city of Konstanz on Sunday, killing one person and seriously injuring three others, police said.
The suspect suffered life-threatening injuries in a gunfight with police officers outside the music venue after they had rushed to the scene shortly after the incident around 0230 GMT.
The suspect has been taken to hospital. The motive for the shooting is unclear. One police officer was also injured in the exchange of fire with the suspect.
Police said in a statement that special commando forces have been deployed in the city as it was not clear if the suspected had acted alone or had accomplices.
On Friday, a failed asylum seeker killed one person and injured six others in the northern city of Hamburg. Officials said he was an Islamist known to security forces and he had was psychologically unstable.
The Konstanz gunman who killed one person and injured three others in a nightclub in southern Germany on Sunday was an Iraqi citizen who had lived in the country for a long time and was not an asylum seeker, police said in a later statement, ruling out terrorism as a motive.
Konstanz police spokesman Fritz Bezikofer told the n-tv broadcaster that after an initial investigation into the events surrounding the shooting at the nightclub in Konstanz on the border with Switzerland investigators ruled out terrorism.
"The motives of the man who acted alone are unclear," he said. "We are still investigating but the circumstances surrounding the events at the disco in the evening before the shooting are a bit clearer and this led us to rule out a terrorism background."