CHINA is in a frightening mood. The sight of thousands of Chinese people waving xenophobic fists suggests that a country on its way to becoming a superpower may turn out to be a more dangerous force than optimists had hoped. But it isn't just foreigners who should be worried by these scenes: the Chinese government, which has encouraged this outburst of nationalism, should also be afraid.

For three decades, having shed communism in all but the name of its ruling party, China's government has justified its monopolistic hold on power through economic advance. Many Chinese enjoy a prosperity undreamt of by their forefathers. For them, though, it is no longer enough to be reminded of the grim austerity of their parents' childhoods. They need new aspirations.

The government's solution is to promise them that China will be restored to its rightful place at the centre of world affairs. Hence the pride at winning the Olympics, and the fury at the embarrassing protests during the torch relay. But the appeal to nationalism is a double-edged sword: while it provides a useful outlet for domestic discontents (see article), it could easily turn on the government itself.

A million mutinies

The torch relay has galvanised protests about all manner of alleged Chinese crimes: in Tibet, in China's broader human-rights record, in its cosy relations with repellent regimes. And these in turn have drawn counter-protests from thousands of expatriate Chinese, from Chinese within the country and on the internet.

Chinese rage has focused on the alleged “anti-China” bias of the Western press, which is accused of ignoring violence by Tibetans in the unrest in March. From this starting-point China's defenders have gone on to denounce the entire edifice of Western liberal democracy as a sham. Using its tenets to criticise China is, they claim, sheer hypocrisy. They cite further evidence of double standards: having exported its dirtiest industries to China, the West wants the country to curb its carbon emissions, potentially impeding its growth and depriving newly well-off Chinese of their right to a motor car. And as the presidential election campaign in America progresses, more China-bashing can be expected, with protectionism disguised as noble fury at “coddling dictators”.

China's rage is out of all proportion to the alleged offences. It reflects a fear that a resentful, threatened West is determined to thwart China's rise. The Olympics have become a symbol of China's right to the respect it is due. Protests, criticism and boycott threats are seen as part of a broader refusal to accept and accommodate China.

There is no doubt genuine fury in China at these offences; yet the impression the response gives of a people united behind the government is an illusion. China, like India, is a land of a million mutinies now. Legions of farmers are angry that their land has been swallowed up for building by greedy local officials. People everywhere are aghast at the poisoning of China's air, rivers and lakes in the race for growth. Hardworking, honest citizens chafe at corrupt officials who treat them with contempt and get rich quick. And the party still makes an ass of the law and a mockery of justice.

Herein lies the danger for the government. Popular anger, once roused, can easily switch targets. This weekend China will be commemorating an event seen as pivotal in its long revolution—the protests on May 4th 1919 against the humiliation of China by the Versailles treaty (which bequeathed German “concessions” in China to Japan). The Communist Party had roots in that movement. Now, as then, protests at perceived slights against China's dignity could turn against a government accused of not doing enough to safeguard it.

Remember the ides of May

Western businessmen and policymakers are pulled in opposite directions by Chinese anger. As the sponsors of the Olympics have learned to their cost, while consumer- and shareholder-activists in the West demand they take a stand against perceived Chinese abuses, in China itself firms' partners and customers are all too ready to take offence. Western policymakers also face a difficult balancing act. They need to recognise that China has come a long way very quickly, and offers its citizens new opportunities and even new freedoms, though these are still far short of what would constitute democracy. Yet that does not mean they should pander to China's pride. Western leaders have a duty to raise concerns about human rights, Tibet and other “sensitive” subjects. They do not need to resign themselves to ineffectiveness: up to a point, pressure works: China has been modestly helpful over Myanmar, North Korea and Sudan. It has even agreed to reopen talks with the Dalai Lama's representatives. This has happened because of, not despite, criticism from abroad.

Pessimists fear that if China faces too much such pressure, hardliners within the ruling elite will triumph over the “moderates” in charge now. But even if they did, it is hard to see how they could end the 30-year-old process of opening up and turn China in on itself. This unprecedented phenomenon, of the rapid integration into the world of its most populous country, seems irreversible. There are things that could be done to make it easier to manage—including reform of the architecture of the global institutions that reflect a 60-year-old world order. But the world and China have to learn to live with each other.

For China, that means learning to respect foreigners' rights to engage it even on its “internal affairs”. A more measured response to such criticism is necessary not only to China's great-power ambitions, but also to its internal stability; for while the government may distract Chinese people from their domestic discontents by breathing fire at foreigners, such anger, once roused, can run out of control. In the end, China's leaders will have to deal with those frustrations head-on, by tackling the pollution, the corruption and the human-rights abuses that contribute to the country's dangerous mood. The Chinese people will demand it.