BEIJING — A knife attack at a supermarket in Shanghai killed three people and injured 15 others, local police said.

A 37-year-old man surnamed Lin was taken into custody by police responding to the report of the attack Monday evening, the local Songjiang police branch said in a statement Tuesday.

Eighteen people were sent to hospital for treatment, and three later died.

An investigation is underway, the statement said.