There was no evidence so far pointing to a religious motive, they added, despite the suspect reportedly yelling "Allahu akbar."
The 27-year-old unemployed carpenter, Paul H., used a survival knife on Tuesday to stab and slash his four victims at Grafing railway station east of Munich.
"The investigating judge of Munich district court has ordered that the accused today be temporarily placed in a psychiatric hospital," said Bavarian police in a statement.
The barefoot assailant shouted "Allahu akbar" (God is greatest) and threatened to kill "non-believers", sparking initial fears of a jihadist attack, but police who detained him quickly said he appeared to be mentally confused.
More From This Section
It has since emerged that the man had spent Sunday in a psychiatric ward in central Hesse state but had left there on Monday morning.
He then caught a train south to Munich where, surveillance camera footage showed, he spent the night at the central railway station and then at Grafing, where he launched his dawn attack.
Today, the steps to the train station were covered with flowers and candles for the victims -- a 56-year-old man who died, and three other men aged between 43 and 58 who, police said, were now all in stable condition.
"Warm sympathies to the relatives and friends of the deceased and the injured," read one condolence card placed on the station's steps. "We suffer and mourn with you.