Four people were lightly injured in the southern German city of Munich by a man wielding a knife who fled the scene, said police.
They later detained a man who resembled witness descriptions of the attacker.
The man attacked passersby in five places near Rosenheimer Platz in the eastern part of the city centre this morning, inflicting "light" injuries on four people, a police spokesman said.
He also tried, but failed, to stab two others,
Police said "no life threatening injuries" were suffered by the victims.
Local police described the attacker as a man in his 40s, wearing grey trousers and a running jacket, who fled on a black bicycle.
He was also carrying a backpack and a camping bed roll.
Police spokesman Marcus da Gloria Martins said that police were not sure what the attacker's motive was and that they could only name the detained suspect once they had determine that he was behind the attack.
There are no indications that the man detained had acted out of religious or political motives, the head of the police force said.
Munich police chief Hubertus Andrae told a news conference that he suspects the man has mental health problems.
In July 2016, a German-Iranian teenager who police say was obsessed with mass murderers, shot dead nine people at a Munich shopping centre before turning the gun on himself.