Two people were seriously wounded in the attack Tuesday in Mellrichstadt, a small town east of Frankfurt in southern Germany, police said in posts on social network X, AP reported.
A 21-year-old German man was arrested.
There was no danger to the public, authorities said.