LEO YAO thought he had nothing to fear from the environment ministry. Before, when its inspectors visited his cutlery factory, he says, they generated “loud thunder, little rain”. After warning him to clean up, they would, at worst, impose a negligible fine. Not so this time. In August dozens of inspectors swarmed over his workshop in Tianjin, just east of Beijing, and ordered production to be halted. His doors remain shut today. If he wants to go on making knives and forks, he has been told that he must move to more modern facilities in a less populated area.

Mr Yao’s company, which at its peak employed 80 people, is just one minor casualty in China’s sweeping campaign to reduce pollution. For years the government has vowed to go green, yet made little progress. It has flinched at reining in dirty industries, wary of the mass job losses that seemed likely to ensue. But in the past few months it has taken a harder line and pressed on with pollution controls, hitting coalminers, cement-makers, paper mills, chemical factories, textile firms and more.

Tens of thousands of companies—mostly smaller ones, like Mr Yao’s—have been forced to close, according to Chen Xingdong, an economist with BNP Paribas. In the region around Beijing this winter, the government has ordered steel mills to run at half-capacity and aluminium-makers to cut output by nearly a third. Implementation, half-hearted in the past, has if anything been heavy-handed. In Hebei, a northern province, a ban on coal heating left thousands of residents shivering because the replacement, a switch to natural gas, was not yet ready.

For the wider economy, the question is how steep the cost will be. A sharp tightening of environmental rules in the world’s biggest polluter has the potential to be a shock, both to China and the global economy. Two worries are commonly heard: that it will drag down growth; and, at the same time, cause inflation as production cuts boost prices. Jiang Chao, an economist with Haitong Securities, a broker, says it could end up making for “classic stagflation”. So far, though, these worries are unfounded: growth has been solid and inflation subdued. A possible explanation is that the economic impact is lagging behind the pollution controls. Another is that, contrary to received wisdom, China may be able to raise its environmental standards without paying a high price.

One thing is clear: China’s shift on pollution is real. True, some extreme measures are temporary, especially those aimed at keeping Beijing’s sky blue this winter. But many others will be lasting. As part of a “war on pollution” declared in 2014, China has detailed targets for cleaning up its air, water and soil. On January 1st it introduced an environmental-protection tax, replacing a patchwork of pollution fees. Last month it launched a market for trading carbon emissions, which, though scaled back from early plans, will be the world’s largest. Most crucially, the environment ministry, previously a political weakling, has clout at last—as Mr Yao’s cutlery business found to its chagrin. Besides fining companies, inspectors have disciplined some 18,000 officials for laxity over pollution.

The tougher tactics have already made a big dent in specific industries. Just 60% of steel blast-furnaces are now in use, down sharply since October and near a five-year low. Thermal-power output is now actually declining year by year, evidence of weakening demand. Companies are also feeling the pinch. Schaeffler Group, a German car-parts maker, warned in September that pollution controls would knock out its supplier of needle bearings. Taiwanese chipmakers in the city of Kunshan, an electronics hub not far from Shanghai, say the abrupt tightening of water-quality rules may lead them to move.

Upward pressure on production costs has been intense. A surge in coal and steel prices has attracted most attention, as China has pushed companies to cut capacity (see chart). But similar trends affect a range of smaller industries. In July China banned imports of 24 kinds of waste such as paper and plastic; the ban came fully into effect on January 1st, but demand (and prices) for raw pulp quickly jumped. Restrictions on the chemicals industry have fuelled a 50% increase in the price of glyphosate, a popular weedkiller, over the past few months. Prices of rare-earth metals, notably two used in electric magnets, have also soared.

Yet the biggest economic surprise of China’s environmental campaign so far is not that it has had an impact; it is how muted that impact has been. Yes, industrial production has recently been weaker than forecast, but it is still expanding at more than 6% year on year. And yes, some commodity prices have shot up, but this has had very little effect on general inflation. Three factors suggest that this benign trend may endure. First, despite the common assumption that industries such as steel or coal are vast, they in fact account for a small, shrinking share of the Chinese economy. Minsheng Securities, a broker, calculates that the full complement of industries affected by the pollution measures adds up to just 7% of total national investment. China has reached a stage of development where manufacturing is fading in importance. Nearly 4m people may lose jobs as a result of cuts in industrial capacity, but strong demand for labour in the services sector, from restaurants to health care, is cushioning that blow. Second, price increases have been concentrated and show little sign of spreading widely. Prices of coal and steel, the first to heat up, are already levelling off, making the increases seem big one-off changes rather than the start of inflationary spirals. For the economy as a whole, it amounts to a redistribution of resources. Companies that use commodities as inputs face higher costs. But producers benefit. And since metals and mining companies are heavily indebted, the rebound in revenues is helping to fortify their balance-sheets and, in the process, easing Chinese financial risks. Lastly, green restrictions can themselves generate growth and jobs. China’s drive for cleaner energy sources has gained momentum. Estimates suggest it installed nearly 55 gigawatts of solar-power capacity in 2017, more than the existing capacity of any other country at the start of the year. China accounts for about two-fifths of global production of electric cars. And in more established industries, companies feel pressure to upgrade. To stay in business, Mr Yao says he will move his cutlery factory to a new industrial park, where waste-disposal standards are higher.

If the economic downside from China’s clean-up remains relatively mild, it prompts an obvious question: why did it take the government so long to get tough on pollution? One big reason is surely the uneven distribution of pain. Smokestack industries are based in a small number of provinces such as Shandong in the east and Shanxi in the north. So long as enforcement was in local hands, officials had little incentive to act. None wanted to throttle companies in their own backyard. But from a national perspective, the economic trade-offs of greener growth ought to be easier to stomach. China will both pay a price and reap dividends.