One day after the knife attack at a primary school in Esslingen, Swabia, the judiciary took the suspect into custody.

The public prosecutor's office in Stuttgart and the police in Reutlingen announced on Saturday that the 24-year-old was being investigated on suspicion of attempted homicide.

The man is said to have seriously injured a seven-year-old girl and a 61-year-old caregiver with stitches on Friday.

The Esslingen Criminal Police Department formed a group of 13 investigators to investigate the attack.

"The German-born, Dutch national has not yet appeared in the police force," the statement said, referring to the suspect.

The man confessed.

The possible motive for the crime is still being determined.

A mental illness is included and checked by an expert, according to the investigators.