As China flexes its muscles as an international power, it is finding its national interests and much-touted objection to interference in the domestic affairs of independent states do not always mesh comfortably.
The current case in point is the forthcoming referendum -- after more than 50 years of civil war -- on the separation of Sudan, where China has major oil interests, into the largely Arab and Muslim north and the black African Christian and animist south.
For many years, Beijing has been a dogged and important supporter of the government of Sudan, dominated by the Arab north and its leader Omar al-Bashir, who is under international indictment for crimes against humanity.
Using the mantra of refusing to interfere in the doings of independent states, China has used the threat of its Security Council veto at the United Nations to blunt sanctions against the al-Bashir regime.
This, of course, helps protect Beijing's agreements with Khartoum under which China buys more than 60 per cent of Sudan's oil output, which accounts for more than six per cent of China's oil imports.
But the whole geography of China's involvement in Sudan could change radically in six months with the Jan. 9, 2011, referendum on the separation of Africa's largest country into two new states.
At least 80 per cent and perhaps as much as 95 per cent of the region's known oil reserves could end up in the new country of the south if the southerners, as expected, vote for independence.
Moreover, the government-in-waiting in southern Sudan, based in Juba, has already expressed concerns about the current contracts between Khartoum and the oil companies, which include Malaysia's Petronas and India's Oil and Natural Gas Corp. in small minority roles.
This raises the prospect that a new Juba-based government in the south would at least want to review the existing contracts and -- with its much greater attachment to the West than that of al-Bashir's pariah regime -- could insist on new contracts with new players. This prospect has brought Beijing face-to-face with the daily difficulties of managing a global mandate.
Beijing is trying to edge towards establishing functional relations with Juba, where it has set up a consulate, and the interim government made up of members of what used to be the separatist rebel army, the Sudan People's Liberation Movement.
To sweeten its message of friendship, Beijing is offering, as in other parts of Africa where it is establishing relations, to build much-needed infrastructure on advantageous terms.
But the Chinese government starts this effort from the uncomfortable position of having been a staunch supporter of al-Bashir's repression of not only the south, but also of his abuses in the northwestern Darfur region, where the activities of his military and the government-sponsored janjaweed militias engaged in ethnic cleansing or would-be genocide against local people, depending on one's definitions of those phrases.
China has been the Khartoum government's major arms supplier since 1996. This has been a vicious circle of the purest form with Khartoum using its petro-dollar income from selling oil to China to buy Chinese arms to slaughter Sudanese people who have the temerity to question Khartoum's right to rule.
It must be said that even Beijing became a little queasy at this revolting concoction.
In 2007 the Chinese government tempered its outright protection of al-Bashir and stopped blocking UN Security Council resolutions calling for the deployment of peacekeepers in Darfur. Beijing even pressed Khartoum to stop frustrating the fielding of UN troops. This was a significant breach in Beijing's doctrine of noninterference and came in parallel with the Chinese government's increasing involvement in international peacekeeping operations.
Although Beijing is preparing for Sudan to split in two, it clearly hopes that doesn't happen, with the complications for China's oil contracts that would follow.
A couple of weeks ago Beijing's special envoy to Africa, Liu Guijin, said during a visit to Khartoum: "We will be delighted to see Sudan remaining united, but at the same time we will respect the choice of the Sudanese people."
But it is by no means clear that January's referendums -- there are two -- will produce a clear and conclusive outcome.
Last week a coalition of 26 international and local humanitarian organizations involved in various capacities in trying to alleviate the effects of the 55-year civil war in which at least two million people have died warned that the country is "alarmingly unprepared" for the referendums.
The report points out that since the comprehensive peace agreement ending the civil war was signed in 2005 key parts of the preparations for the referendums on separation, especially agreements over the sharing of oil revenue, have not been completed.
The result, says the report, is that the country is in a volatile state and could easily return to civil war.
If, as expected, the south votes for separation, this lack of agreement on sharing of oil revenues will immediately bring a confrontation with the Khartoum government, which depends heavily on those revenues to survive.
There is already a flash point, though, in the Abyei border region between north and south, which will be the site of the second referendum.
The people of Abyei will be asked if they want to continue their current special administrative status as part of the north or to join the south, either as part of a united Sudan or as a newly independent country.
Abyei accounts for a quarter of Sudan's oil output, and an important oil pipeline from the south runs through the territory to Port Sudan on the Red Sea. But the population of Abyei is divided between the Ngok Dinka, closely related to the Dinka who are a dominant group in southern Sudan, and the Messiria, who are old allies of the Khartoum government.
There has been antagonism between the two groups since the start of the civil war in the 1950s and the fate of Abyei has become central to the conflict.
Already there have been attacks on Ngok Dinka villages by Messiria militias aligned with Khartoum in much the same behaviour as the janjaweed of Darfur.
So Beijing may well find that protecting its economic interests in Sudan next year comes with some very unappetizing strings attached.