The suspect in a recent knife attack at Hamburg's central train station was released from a psychiatric hospital on the day before the incident, officials say.
The 39-year-old woman had been treated in a psychiatric institution in the northern German city of Cuxhaven for three weeks after she was found in a state of distress in early May, a spokesman for the Health Ministry in the state of Lower Saxony said.
The woman, a German national, was detained on Friday evening after allegedly stabbing people at random at the busy transport hub, injuring 18 people.
She has admitted to the act in front of a magistrate, a spokeswoman for prosecutors told dpa on Sunday.
The suspect, who hails from the northern state of Lower Saxony, has been known to police since 2021, a spokesman for the state Interior Ministry said.
"She appeared at police stations several times, showing clear signs of mental illness," the spokesman said.
Police initiated criminal proceedings against the woman in several cases last year, according to the ministry.
Following an incident at the beginning of May, a court ordered her to be placed in the Cuxhaven psychiatric hospital, where she received treatment for three weeks.
According to the clinic, the woman was released because there were no medical findings at the time of her discharge to justify further treatment.
Authorities did not comment on the nature of her illness, citing privacy concerns and medical confidentiality.
Before patients are released from a psychiatric ward, doctors have to consider whether they could pose a danger to themselves or others.
Authorities in Lower Saxony say there was no indication that the suspect may have used a knife in previous incidents, nor does she have a firearms licence.
A magistrate ordered the woman to be placed in psychiatric care after she was detained following the stabbing on Friday.
She is accused of 15 cases of attempted manslaughter combined with grievous bodily harm.
The charges relate to the people who were directly injured with the knife and suffered cuts or stab wounds of varying severity, according to police.
The remaining victims suffered other injuries, due to shock or falls.
According to earlier police reports, the act was not politically motivated.
Three women aged 24, 52 and 85, as well as a 24-year-old man, were taken to hospital with life-threatening injuries after the attack.
Police said in an update on Saturday that they were all stable.
Seven other people were seriously injured, and seven people sustained minor injuries.