A gunman opened fire at a packed nightclub in southern Germany early Sunday, killing one and wounding four before being shot by police, authorities said, ruling out a terror attack.

The shooter targeted the Grey club in an industrial part of the city, on Max-Stromeyer-Strasse, at about 4:30am, killing one person and injuring three others. One policeman was also injured.

The 34-year-old man, identified as an Iraqi national, later died in hospital of injuries suffered in a gunfight with police outside the venue. "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.

"We're not assuming that this is an act of terrorist violence," police spokesperson Fritz Bezikofer told rolling news channel NTV.

"The events in the disco and all the links are somewhat clearer and they actually rule out a terror background," he said, adding that the gunman was not an asylum seeker and has been living in Germany for some time.

Police said that a dispute among criminals may have led to the shooting in an industrial area of the city.

Hundreds of revellers are thought to have been at the club. Police said they either fled outside in terror, or found places to hide as the shooting unfolded.