In early March, Sudan allegedly bombed a remote oil field at El Nar, nine miles from the jagged, contested border between Sudan and South Sudan, sending Chinese and other foreign oil workers scattering for their lives. (Sudarsan Raghavan/The Washington Post)

— On the day South Sudan became independent last year, China opened an embassy here, eager to protect its oil interests. It quickly dispatched its foreign minister and began discussing a huge aid package for this destitute land.

Just a few months later, Beijing finds itself trapped in a bitter wrangle between South Sudan and its former rulers in Sudan, with both countries pressing Beijing to take their side.

The dispute has cut off a significant source of oil to fuel China’s booming economy and imperiled billions of dollars in Chinese investments. It has also threatened Beijing’s diplomatic and economic relations with both the countries and strained the boundaries of a long-standing Chinese policy of noninterference in the internal affairs of other nations.

“This new reality has left China uncomfortably stuck in the middle of a tug of war,” said Zach Vertin, a Sudan analyst with the International Crisis Group, a nonprofit think tank. “Both sides have attempted to leverage the Chinese oil interest and draw them in line with their own interests.”

The saga playing out in one of the world’s poorest regions highlights the troubles an increasingly prosperous China faces as it tries to adjust to tumultuous change: from Sudan to Libya, Syria and Burma, Beijing has resisted what it portrays as Western-style meddling. But by staying on the sidelines, China has jeopardized its interests and image as a friend of the developing world. Many Arab nations, for example, were furious when China joined Russia in blocking United Nations action on Syria.

At the center of the struggle between the two Sudans is oil, which until last summer was controlled by Khartoum but which now lies mostly within the borders of the world’s newest state, the Republic of South Sudan. China is the biggest player in the oil industry on both sides of the frontier: It holds big stakes in the main oil fields in the south and in pipelines and other infrastructure in the north.

After years of providing diplomatic cover and weapons to a regime in Khartoum ostracized by the West, China must face up to a simple fact, said Pagan Amum, the secretary general of South Sudan’s ruling party: “The master has changed. It was Khartoum. Now it is Juba.”

China’s efforts to shift gears in Sudan began in 2005, with the signing of a peace deal between Khartoum and southern rebels. The agreement ended what was Africa’s longest civil war and paved the way for South Sudan’s independence in July. But officials today say that the Chinese have not done enough to erase suspicions rooted in Beijing’s long support for Sudan’s president, Omar Hassan al-Bashir, an indicted war-crimes suspect who used Chinese-supplied arms in trying to prevent the south from seceding.

South Sudan, which depends on oil for 98 percent of its revenue, insists that it wants to remain partners with China. But South Sudanese officials warn that if Beijing does not align its interests with their country, they will seek out U.S. and Western oil companies.

In testimony before the Senate Foreign Relations Committee this month after a trip to South Sudan, Hollywood star George Clooney, a longtime critic of Bashir’s regime, noted that China’s massive investment in Sudan makes Beijing crucial to settling continuing violence in the region. China, he said, has invested about $20 billion, but “right now they are getting nothing from this” because of feuding between Khartoum and Juba. Clooney and several members of Congress were later arrested during a protest at the Sudanese Embassy in Washington.

Khartoum, which depends heavily on Chinese investment, trade and aid, is determined to keep Beijing on its side. The government dispatched a senior envoy to Beijing last month and has exerted influence over Chinese-led oil consortiums, which pump most of their oil in the south but still need the north to get it to China.

The south has refused to pay hundreds of millions of dollars in royalties for using Sudan’s pipelines, saying that the fees were exorbitant. Sudan responded by seizing oil tankers carrying South Sudanese crude and imposed a blockade on the export of the oil. Last month, South Sudan shut down its oil production, roughly 350,000 barrels a day, after accusing Sudan of stealing $815 million worth of its oil.

South Sudan says it will pay less than $1 a barrel in fees to transport oil through the north’s pipelines. Khartoum says it wants $36 a barrel and $1 billion in back payments. The two sides are even fighting in a London court, as South Sudan seeks to recover money from the sale of the seized crude.

South Sudan said recently that it intends to build a pipeline that would head south to Kenya. It is not clear who would fund such a massive project, but, if built, the pipeline would sharply reduce Juba’s dependence on the north — and the value of China’s huge investment in existing pipelines to Sudan’s Chinese-built oil export terminal on the Red Sea.

An old alliance under threat

It was inevitable that China would get tangled in the dispute. The state-owned China National Petroleum Corp., or CNPC, has a big stake in most of the biggest oil concessions. The oil from both Sudans represents at least 5 percent of China’s global crude imports.

This is much less than what China imports from Angola but is still important, especially as it is produced mainly by Chinese companies that are controlled by the state and, thus, in Beijing’s view, are more reliable. Angola’s oil, by contrast, is largely pumped by Western companies.

China also has great leverage over Sudan. Beijing provides massive loans to the north; oil and trade bring in billions more in foreign currency, vital to run Sudan’s economy and to buy weapons.

CNPC, whose boss in Beijing is appointed by the ruling Communist Party, declined to comment for this report. The company requested and received written questions but did not respond. In public comments, Chinese officials have sought to maintain neutrality, saying that both Sudans “can only achieve common development through peaceful co-existence.”

In Juba, officials stressed that China should make greater efforts to persuade Khartoum to accept South Sudan’s position. “We are not asking China to help us. We are asking China to help itself with its friend,” Amum said. He made clear that Juba would no longer tolerate China’s alliance with Khartoum.

“They are used to looking north,” he said. “They are now being told to turn around, southward.”

There are signs that China’s previously rock-solid support for Khartoum might be softening. In a recent interview with Qatar’s al-Raya newspaper, Bashir complained that Beijing had cancelled a loan to his government for a big agricultural development project. China pulled out, the Sudanese president said, because Khartoum was due to repay the money with oil shipments, which had been disrupted by the south’s independence.

Even so, it is unlikely, analysts said, that China would jilt Khartoum for Juba — that would probably alarm other repressive and corrupt regimes, such as those in Angola and Equatorial Guinea, where China has forged highly profitable oil relationships.

“The Chinese are not going to throw away old friends,” Vertin said. “They won’t abandon Sudan. That would be a bad precedent for them.”

Sudan also has some powerful and so far loyal friends in Beijing, though how long this lasts may depend as much on the labyrinthine internal politics of the Communist Party as events in Africa. One of Khartoum’s biggest backers in Beijing for years has been Zhou Yongkang, a member of the party’s Politburo Standing Committee responsible for security. In recent days, however, rumors — all unconfirmed — have swirled in Beijing that Zhou is in deep political trouble after the purge last week of a senior party official with whom he is thought to have been allied.

Zhou used to be the head of CNPC, the state oil company, and led its push into Sudan’s oil sector in the 1990s after American and other Western companies pulled out. He has visited Khartoum repeatedly.

China’s predicament

Amid mounting anger in Juba over China’s continuing coziness with Khartoum, South Sudan on Feb. 20 expelled Liu Yingcai, the head of Petrodar, a consortium that is majority owned by CNPC.

In a letter, the Juba government accused Liu of colluding with Khartoum to steal South Sudan’s oil and of not fully cooperating with orders to shut down oil production. Petrodar, in a statement, denied the allegations. The consortium said it had ordered staff members “not to comply with the forced lifting” of oil, which it said was done by members of Sudan’s national security forces.

Now, South Sudan has launched an investigation of Petrodar to determine the extent of its role in the oil theft. Juba is also probing the actions of the Greater Nile Petroleum Operating Co., an oil consortium that is 40 percent owned by China and that also may have helped Khartoum steal oil. If the consortiums are found sufficiently guilty, Amum said, their contracts could be terminated.

“It will be an opportunity for others, with possibly even better technology, to come in,” Amum said. “If the Chinese are not with us, we will have another very good story, too. With the Chinese or with others, we will prosper.”

As tensions between the two Sudans grow, China’s predicament becomes more precarious. Last month, Sudan allegedly bombed an oil field at El Nar in South Sudan, nine miles from the jagged, contested border between the two countries, sending Chinese and other foreign workers maintaining the oil wells scrambling for their lives.

“They bombed this place because of the oil,” said Miakol Lual, a local tribal chief. The attack destroyed portions of the oil infrastructure.

“It’s a message to all foreigners: ‘You deal with us, not the other side,’ ” said a foreign supervisor who spoke on the condition of anonymity because he was not allowed to talk to the media. Khartoum has denied attacking the field.

In Juba, Chinese expatriates are growing anxious. In January, rebels linked to South Sudan kidnapped 29 Chinese workers in Sudan, releasing them last month. The Chinese Embassy has ordered all its nationals to stay in at night and not discuss anything sensitive with locals.

“Everyone is worried about the situation,” said a Chinese telecommunications worker who spoke on the condition of anonymity because he feared he would get fired. “If things get worse, we have made preparations to move out of here.”