ALONE of the five permanent members of the UN Security Council, China has yet to recognise the new government in Tripoli, a clue as to how the recent upheaval in the Arab world has put unusual stress on the country's much-vaunted hands-off policy when it comes to others' affairs. With growing economic interests and ever more citizens to worry about in far-flung regions, Chinese policymakers are tweaking their strategy. A more normal—that is to say, less reactive—big-power approach could be slowly in the making.

Rhetorically, the principle of “non-interference” remains sacred. On September 6th China issued a white paper on its “peaceful development” (ie, rise), its first on the topic since 2005, well before financial crisis crushed Western economic confidence and propelled China even more to the fore in international terms. The document said China still upheld the principle and that it respected the right of others to “independently choose their own social system and path of development”. Usually this has meant supporting whoever is in power no matter how thuggish or unpopular. In Libya, though, China wavered.

It could have done as it did in earlier Arab uprisings: wait on the sidelines and recognise the legitimacy of opposition movements only after dictators had fallen. But Libya presented an unusual combination of challenges for China. These included demand at home for prompt action to ensure the safety of more than 35,000 Chinese working in the country; widespread support among (China-friendly) Arab countries for tough action against Muammar Qaddafi; and economic interests in Libya that might be threatened by supporting the wrong side.

China's response at the start of the year to the upheaval in Egypt was typical of the old style. The state-owned media were quick to portray Cairo's anti-government demonstrators as lawless troublemakers and played down their impact. The Communist Party did not want citizens at home to get any ideas. After President Hosni Mubarak's resignation in February, and with calls for a Chinese “jasmine revolution” circulating on the internet, many police were deployed in the centres of big cities to prevent any copycat unrest. China appeared defensive and insecure.

But its approach to the Libyan unrest proved somewhat different. First came its decision to vote in favour of UN sanctions against Colonel Qaddafi. Then it mounted a big operation to fly out its citizens on chartered flights and four military aircraft (China also sent a frigate from its duties off the Horn of Africa to provide protection for vessels transporting refugees across the Mediterranean). The official media called this the largest such operation China had mounted abroad since the Communist takeover in 1949. In a recent paper, the European Council on Foreign Relations, a think-tank, said these moves seemed to reflect China's realisation that a posture of non-interference was “increasingly at odds with its global economic presence”.

In March China retreated somewhat by abstaining in the vote on the UN Security Council resolution that authorised “all necessary measures” to protect civilians in Libya. But it knew what the outcome would be: a NATO-led operation (the very words fill Chinese nationalists with anti-imperialist loathing) aimed at hastening Colonel Qaddafi's downfall. To protect itself from the nationalists' venom, the Chinese government condemned the NATO air strikes and avoided any hint of support for the rebels' cause.

But then in June the government dipped its toes into the conflict, first by meeting the rebels in Qatar and then by sending a diplomat to meet them in Benghazi itself (ostensibly to discuss the humanitarian situation and the security of Chinese businesses). In late June a senior official of the rebels' National Transitional Council (NTC) held talks in Beijing with China's foreign minister, Yang Jiechi. This was followed in July by another visit to Benghazi by a senior Chinese diplomat. Although China has not officially recognised the NTC's late-August assumption of power in Tripoli, on September 1st it sent a deputy foreign minister to the Paris summit on Libya, where he met the NTC's chairman, Mahmoud Jibril.

Yet China did not abandon Colonel Qaddafi. In June it received his foreign minister in Beijing. This week it confirmed that his representatives had also visited Beijing in July on a weapons-buying mission (reports of this having appeared in a Canadian newspaper based on documents found in Tripoli). China's foreign ministry denied, however, that any arms were shipped and said the visit took place without the government's knowledge. NTC officials say they believe some countries including China supplied weapons to Colonel Qaddafi's government after the Security Council's approval in February of a ban on such assistance.

Now China worries that Libya's new authorities will make it pay for its support for the old regime by discriminating against it in business deals, including potentially lucrative ones related to the oil industry. During Colonel Qaddafi's rule, China had big interests in Libya's economy. Chinese media say it was involved in projects worth more than $18 billion when the conflict broke out, mostly in construction. Libyan oil last year accounted for just 3% of China's crude imports, but Chinese oil companies are keen to get bigger stakes.

A need for oil and other resources greatly shapes Chinese foreign policy in Africa. Having long supported the government of Sudan (a big supplier of oil) in its fight against secessionist rebels, China eventually swung into line with Western governments. It was quick to recognise oil-rich South Sudan when it seceded in July, having sent observers to monitor its referendum on independence.

China will remain extremely cautious, however. It does not want to send signals at home that rebellion can ever be justified. Despite the police crackdown earlier this year, which involved a sweeping round-up of dissidents, occasional articles still appear online and even in the official media urging the government to learn lessons from the Arab world's upheavals. Before the authorities rushed to delete it, a Shanghai newspaper managed to publish a commentary on its website giving warning that unless it “gradually but resolutely” gave its people more political choice, every developing country faced the same “nightmare” of violent upheaval.