HONG KONG — China has long been known as a place where the world’s dirtiest mines and factories can operate with impunity. Those days may not be over, but a growing environmental movement is beginning to make the most polluting projects much harder to build and operate.

Large and sometimes violent demonstrations against the planned construction of one of the largest copper smelting complexes on earth prompted local officials in southwestern China’s Sichuan Province to continue backpedaling furiously on Wednesday. The local government of Shifang, the planned site of the smelter, announced in a statement that the construction of the $1.6 billion complex had not only been suspended but also permanently canceled.

The smelter was supposed to be the centerpiece of a planned economic revitalization of an area devastated by the 2008 Sichuan earthquake, through the creation of thousands of construction jobs at a time when the overall Chinese economy is suffering a sharp slowdown.

A police official in Shifang said in a telephone interview that everyone detained in the protests had been released. The police acted after a crowd estimated by local residents in the tens of thousands defied the police and assembled Tuesday evening to demand the release of dozens of students jailed in the protests on Sunday and Monday.