hospital Shanghai
© Brenda Goh/ReutersAgence France-PressePolice officers outside Ruijin hospital in Shanghai following the incident on Saturday morning.
Four people have been wounded in a stabbing at a Shanghai hospital, local police said, before the knife-wielding attacker was shot and subdued by officers.

Huangpu district police said on social media that they received emergency reports at 11.30am local time (0430 BST) on Saturday of a stabbing at Ruijin hospital.

"The police quickly arrived on the scene and discovered a man holding a group of people hostage with a knife on the hospital's seventh floor," the statement said. "When the suspect intended to injure the hostages and punish the police, the police decisively fired a shot to injure and subdue him."

Four members of the public were being treated for wounds and were not in a life-threatening condition, the statement added.

The attacker's motive remains unclear.

Chinese media published videos showing armed police trying to break into a locked room in the hospital. Another heavily circulated social media video showed more than a dozen members of the public running out of the building.

Mass violent crime is rare in China, which strictly prohibits citizens from owning firearms, but knife attacks do happen occasionally.

Last month, a 23-year-old man in the eastern city of Ningbo died after being violently stabbed on the street in broad daylight. Video of the attack near a bus stop went viral on social media.

In recent years, a string of fatal knife attacks targeting kindergarten and school students have occurred nationwide, carried out by people reportedly wishing to wreak revenge on society.