BERLIN (AP) — A German court has convicted a 30-year-old man who drove into groups of pedestrians in Berlin last year of one count of murder and 16 counts of attempted murder, ordering him to be permanently held in a psychiatric hospital.

The Berlin regional court concluded that the driver, a German citizen born in Armenia, was in a psychotic state when he drove onto the sidewalk in a popular shopping district in the west of the capital in June, killing a teacher and injuring eleven students on a school trip. A pregnant woman, a teenage girl and two men were also injured.

The driver was detained by passers-by before being arrested by police.

The court also banned the man from driving for life.