A man with a knife attacked eight people in Munich on Saturday and then fled, police said.
The suspected assailant, a local German already known to police for theft and other offenses, was arrested a few hours later.
No one was seriously hurt in the attack that started at around 8.30 in the morning in the Haidhausen area, east of downtown Munich.
Police said they believe it was not a terror attack, they suspect instead that the assailant had psychological problems.
The lone attacker apparently went after passers-by indiscriminately with a knife, police said.
He attacked eight people in all, including a 12-year-old child, at different sites. The victims mainly suffered superficial stab wounds.
About three hours later, police arrested an unnamed man matching a description they had issued based on witness reports. They said he was heavy, unshaven with short blond hair and had a black bicycle and a backpack.
The 33-year-old suspect, who was carrying a knife when he was arrested, was already known to police for violent assault, drug offences and theft, city police chief Hubertus Andrae told reporters.
The suspect didn't immediately give police any information on his motive.
"There are absolutely no indications at present of a terrorist, political or religious background, though we can only rule things out when all the questioning is finished," Andrae said.
He added: "Rather than that, we believe that the perpetrator had psychological problems."
The police chief added he had "no serious doubts" that the suspect was the assailant, and that there was no longer any danger to the public.