German police have arrested a suspect after a string of stabbings in the southern city of Munich.

Authorities on Saturday urged residents in the Bavarian capital to stay home after a man on a black bicycle injured four people with a knife and attempted to stab two others.

Five men and one woman were attacked, Munich police spokesman Marcus da Gloria Martins told reporters.

"We have arrested a person who very strongly resembles the description by witnesses, but we cannot confirm that he is the attacker," Martins said.

Munich Police Chief Hubertus Andrae told reporters that the detained man had acted out of political or religious motives.

He said officials believe that the suspect, who had a previous police record, has psychological problems.

Police had earlier described the suspect as a having a "corpulent figure", being unshaven and with short hair, He was carrying a rucksack with a sleeping mat attached.