THE world’s youngest independent country is criss-crossed with battle lines. Following a bloody rupture in mid-December between President Salva Kiir and his former vice-president, Riek Machar, violence has spread across much of South Sudan. Forces loyal to Mr Machar have seized control of parts of Jonglei and all of oil-rich Unity state as well as chunks of Upper Nile, the other main oil-producing state. Governments in the region—mainly those of Ethiopia, Uganda and Kenya—are striving to mediate, so far without success. A ceasefire brokered by the governments of neighbouring countries on December 31st in Ethiopia has yet to be given a starting date.

Adding to fears of further mayhem, the “white army”, so called because its Lou Nuer tribesmen daub themselves in white ash, is also on the march. Columns several thousand strong are reported to be converging from the eastern reaches of the bush in the vast Jonglei state towards Bor, its capital, to join battle against government forces. As The Economist went to press, the rebels claimed to control the city, which is only a few hours’ drive north of Juba, the country’s capital.

Mr Kiir’s forces still control all or most of the country’s other seven states. They have the upper hand in terms of supplies, arms and international support. A foreign military adviser who has worked with both men said that the president has “more options” and is better prepared for a long conflict. But Mr Machar may be able to hold the fledgling country’s oil infrastructure to ransom. If he can chalk up some early victories—for instance, by taking and holding Bor—he may be better placed to sue for peace. As things stand, South Sudan may face a long civil war. What began as a political power struggle within the Sudan People’s Liberation Movement (SPLM), the ruling party, soon took on a lethally ethnic character, pitting the country’s two largest communities against each other: Mr Kiir’s Dinka, the largest of South Sudan’s tribes, versus Mr Machar’s Nuer. At a senior level the ethnic make-up of each side is more complicated; for instance, the foreign minister, Barnaba Marial Benjamin, a Nuer, has stayed loyal to the Dinka president, whereas the widow of John Garang, the SPLM’s Dinka founder, is said to prefer Mr Machar. But on the ground the reality has become brutally tribal; ethnic cleansing has been let rip. Violence first erupted on December 15th, when Dinkas in the presidential guard in Juba sought to disarm their Nuer colleagues. An atmosphere of rumour and paranoia had festered since July, when Mr Kiir sacked his entire government in a bid to limit the power of the ambitious Mr Machar. Once fighting broke out in the presidential guard, Dinkas started indiscriminately attacking Nuer civilians in Juba, killing scores of them. From his shelter under a sheet in the UN base in Juba, Cornelius Khan, a Nuer, describes how Dinka soldiers came to his district, searching “house to house” for Nuer to kill. Tit-for-tat killings then spread across a country the size of France. Two dozen Dinka officials were massacred by White Army men, along with two Indian UN peacekeepers, on December 19th in Akobo, a remote outpost in Jonglei state. That prompted more than 180,000 people to flee their homes; tens of thousands of them have gathered in Lakes state, north-west of Juba. Médecins Sans Frontières, a French-founded charity, said their conditions were “verging on the catastrophic”. Some 80,000 civilians are now crowded into five UN bases, including more than 20,000 at the two in Juba.

The UN has responded by calling for 5,000 more troops, some of whom have begun to arrive, to bolster the 7,500 previously deployed. But the UN mission is demoralised. It has been criticised for failing to see the writing on the wall. Its head, Hilde Johnson, a Norwegian former government minister, is said to have let herself get too close to Mr Kiir, who in turn has been accused by Western diplomats of precipitating the crisis by falsely charging Mr Machar with instigating a coup.

Ugandan troops control the airport in Juba, while Ugandan aircraft are said to have bombed Mr Machar’s rebels in Jonglei. Mr Museveni seems set to send more troops to Mr Kiir’s aid. It has been suggested that Mr Museveni may be eyeing a chance to have South Sudan’s oil transported south via Uganda rather than north through the rump state of Sudan, whose president, Omar al-Bashir, he has long loathed. Ethiopia’s late prime minister, Meles Zenawi, who died in 2012, was an effective counterweight to the erratic Mr Museveni but Mr Hailemariam may be less able to restrain him. “The world is going to miss Meles,” says a UN official involved in previous negotiations.

So far Mr Bashir has kept warily out of the fight. Sudan’s economy depends on the royalties it earns for taking the south’s oil to market via a pipeline to the Red Sea. But if the conflict drags on, he could be tempted to intervene to protect Sudan’s own interests in the oilfields, which are close to the border. In extremis, Mr Machar might seek a deal with Mr Bashir whereby Sudan would get a higher fee for keeping the oil flowing in return for backing Mr Machar.

Meanwhile, China, the biggest importer of oil from both Sudans, is co-operating with the United States and key European countries, especially Britain and Norway, as an honest broker. But it is unlikely that the status quo can be restored soon, if ever. Mr Kiir’s forces are unlikely to defeat Mr Machar’s fighters outright, however energetically Uganda weighs in on Mr Kiir’s side; after all, both lots have decades of experience as bush guerrillas.

If peace is to break out, a new power-sharing arrangement will have to be negotiated. But it is hard now to imagine Messrs Kiir and Machar once again agreeing to cohabit. Less than three years after independence, South Sudan remains in dire danger of being destroyed from within.