WARSAW, Poland (AP) — A man has confessed to stabbing people at a shopping mall in Poland, killing one and injuring nine, and faces charges of homicide and attempted homicide, a prosecutor said Saturday.

The 27-year-old wielding two knives attacked people at the VIVO! mall Friday afternoon in the southeastern town of Stalowa Wola. He was detained by shoppers and handed over to police.

Prosecutors identified him only as a local resident, Konrad K., in line with Poland's privacy laws. A local court ordered his detention for at least three months at a prison that provides psychiatric treatment in the southern city of Krakow.

Regional prosecution head Janusz Woznik said the man blamed society for his problems. If convicted, he could face life in prison.

Eight people were hospitalized, two of them in critical condition.