The suspect was arrested after the attack in the town of Rot am See on Friday afternoon, police said.
Rudolf Biehlmaier, a police spokesman, told German broadcaster n-tv: "According to my information, there were six dead and several injured.
“We are working on the assumption that this was a single attacker."
Biehlmaier said the initial information suggested the suspect, a German citizen, and one or more of the victims, knew each other.
Some of the victims belonged to the same family, he added.
In a statement, police said further information would be released at a news conference with prosecutors and local officials at 4.30pm.
Rot am See is located about 105 miles northwest of Munich.