SHANGHAI—Police forces here started carrying firearms for the first time in six decades in a program several Chinese cities plan to replicate in response to growing fears of violence from crime and terrorism.

Over the weekend, more than 1,000 street-patrol officers began carrying 9mm revolvers, Shanghai's Public Security Bureau said. Several other cities across China were set to begin similar programs.

The move marks one of the biggest policy turns in law-enforcement strategy and comes after knife attacks on March 1 at a train station in China's southwestern city of Kunming left 29 people dead.

That 40-minute rampage ended when trained special-tactics officers shot and killed four attackers. Afterward, members of the public expressed safety fears and law-enforcement authorities said they face increasingly violent criminals.

A month after the Kunming massacre, which was blamed on separatists from the western region of Xinjiang, the Ministry of Public Security announced that more police officers nationwide would be trained to use weapons.