
Police in protective vests and ambulances were seen in large numbers at the site in the northern city of Stade, west of Hamburg, in the wake of the gun rampage.
"Homicides involving multiple victims occurred at a youth welfare facility" in the city, police said. "Five people were fatally injured and additional individuals sustained injuries."
The suspected male shooter has been arrested, and two other people were being held over a possible connection to the events.
There was no longer any danger to the public, they said.
A sixth person died later on Monday afternoon, police said, labelling the crime a likely "extended family tragedy". The six dead are adults and one person wounded in the shooting was in "stable" condition, a police spokesman told AFP.
As news emerged of the shooting, police confirmed that a major operation was under way in Stade, a city of about 50,000 people, on the Elbe river, 50 kilometres (30 miles) west of Hamburg.
Images in local media showed a large contingent of police and ambulances gathered on a cobble-stoned street in Stade while helicopters hovered overhead. "We ask you to leave the area and give it a wide berth for your own safety," police said in an earlier post on X.
Germany has some of Europe's strictest gun laws -- they require anyone under 25 to pass a psychiatric exam before applying for a gun licence -- and mass shootings are relatively rare. But they occur from time to time, and Monday's was among the deadliest in recent times. In February 2020, a far-right extremist shot dead nine people and wounded five others in the central German city of Hanau. In March 2023 a disgruntled former Jehovah's Witness member shot dead six people from the Christian group's congregation in the German city of Hamburg, before turning the gun on himself. In May 2022 a 21-year-old gunman opened fire at a secondary school in northern Germany, badly injuring a female member of staff before being arrested.