"There are no indications of a terrorist background," prosecutor's office spokesperson Peter Müller-Rakow told the Agence France-Presse (AFP) news agency.
The stabbing took place Wednesday afternoon on a regional train near the town of Brokstedt.
Sabine Sütterlin-Waack, Interior Minister of the northern state of Schleswig-Holstein, said that a 16-year-old female and a 19-year-old male were killed in the attack, adding that the two victims knew each other.
The minister said that three of the seven wounded remained in hospital, two of them with critical injuries.
Waack said that many details still remained unclear due to "dynamic" developments, adding that a motive had yet to be established.
Schleswig-Holstein's interior minister praises passengers
What else do we know about the suspect?
The 33-year-old suspect is a stateless man of Palestinian origin. According to Waack, he first arrived in Germany in 2014.
He is set to appear before a magistrate on Thursday.
Police said the suspect went on a stabbing spree just before 3 p.m. local time (1400 GMT).
Three passengers had managed to restrain the attacker, police said. He was then detained by law enforcement when the train reached Brokstedt station.
Police said the suspect had only recently been released from prison before committing the attack. He had been detained in a Hamburg correctional institution in connection with an assault case.
Carsten Ohlrogge, chief prosecutor of the city of Itzehoe in Schleswig-Holstein, said the suspect had three prior convictions.
Police said the suspect had been released from hospital on Thursday after being treated for minor injuries and was again in custody.