Water bottle in hand and rucksack on back, his grey trousers rolled up to reveal spindly legs, 12-year-old Gatwech boarded the first flight of his life. His ear protectors dwarfed his head as he gazed wide-eyed through the window of the Russian-built UN helicopter that lifted into the sky, sweeping over lush plains and thick forests.

Gatwech crossed the invisible frontlines separating government and rebel forces in South Sudan’s civil war. Finally, the aircraft came in to land on a ringfenced field in the village of Akobo, deep in opposition territory, and the boy strained to look at the excited crowd waiting under trees. He was about to be reunited with his family for the first time after nine arduousmonths in a displacement camp.

His best friend beamed, his aunt sang and wept and spat as a blessing, and his uncle gave him a rather formal pat on the head. Gatwech was safe at last. But in the world’s newest and hungriest country, every gain is tentative and every haven fragile. Three days later, there was chaos outside the hospital in Akobo when a cattle thief was bound, chased and whipped by a lynch mob of soldiers, police and vigilantes including rifle-toting children.

The febrile atmosphere is a sign that the rainy season is coming to an end in South Sudan, raising the prospect of renewed fighting. Aid is working here but diplomacy is not.

Famine has been staved off, at least for now, by the efforts of numerous agencies and the UN’s biggest ever humanitarian operation in one country. Yet bad-tempered peace talks between the warring parties have stalled, agreements have proved hollow and the international community has failed to apply the requisite pressure. The intransigence of two men, President Salva Kiir and rebel leader Riek Machar, is seen by many here as dragging the country towards the abyss.

Thousands have been killed and nearly two million have fled their homes since their war broke out last December. Oxfam and other agencies have warned that an expected upsurge in violence could wipe out recent gains in food security and push the number of severely hungry people up by a million in the first three months of 2015. Describing it as a shift from crisis to catastrophe, they say parts of the country could slide into man-made famine early next year.

Children, who make up half the population, suffer the most. When the war started, Gatwech – not his real name – ran for his life after government forces attacked the town where his close family was staying. He was carrying a pair of shoes. “I thought my parents were also running,” he recalled, speaking Nuer through an interpreter. “But when I reached the UN camp, they were not there and I thought maybe they were killed. I was very afraid because I heard a lot of gunshots and artillery.”

Nearly 100,000 people are crammed into UN compounds across the country for their own protection, often in inhumane and unsanitary conditions. Gatwech found himself sleeping on a mat on the floor. “I didn’t have anything to do. It was boring. The day was very long,” he said. The boy, who hopes to become a doctor one day, also witnessed attacks on the camp from government troops. “It was a dangerous life. I saw a lot of dead bodies.”

But months later came the news that Gatwech’s parents had been located in Akobo by a family tracing and reunification programme coordinated by Save the Children. It is long, complicated and logistically difficult work: at present 5,660 children have been registered as missing in South Sudan and only 393 reunited with their families. “It’s a needle in a haystack,” one aid worker said.

When Gatwech landed in Akobo last week, his friend Isaac was there to greet him in a crowd of villagers and wandering cows. The 13-year-old said: “I was very happy. I missed him. We weren’t optimistic because we thought in the long run the only way he would come is when there is peace in South Sudan.”

And peace remains a distant prospect, with Kiir and Machar seemingly hellbent on a military solution. Kiir told the UN general assembly last month: “The conflict in South Sudan is purely a political struggle for power, not an ethnic conflict as reported.” Yet violence has broken out along ethnic lines in many parts of the country, pitting forces loyal to Kiir, a Dinka, against those of his former deputy Machar, a Nuer.

Economic self-interest is also fuelling the conflict. A report last month by the Enough Project noted: “The country’s competing privileged elites are sacrificing their own people’s lives to secure the political and economic benefits – including massive state-corroding corruption – derived from control of the state.”

Political and military leaders maintain “lavish homes” in Kenya, Uganda, Ethiopia, South Africa and Australia, the report continued. “Families of the leaders of South Sudan’s warring parties are living in neighbouring countries and their children are attending the finest schools available. Meanwhile, the education system back in South Sudan has collapsed.”

The Enough Project said the South Sudanese government had received $38m (£24m) in weapons and ammunition from China since the start of the civil war, while there is evidence that opposition forces may have been resupplied with ammunition by Sudan, from which the country gained independence in 2011.

Akobo, a remote cluster of tukuls, or mud huts, in Jonglei state, near the Ethiopian border, was the scene of an infamous massacre in 1983. Last December young Nuer men stormed a UN base looking for Dinka civilians sheltering inside and killed two Indian peacekeepers. Since then the village has been overwhelmed by displaced people, putting pressure on food, schools and hospitals, and driving market prices up. Mobile phone networks have been cut off by the government.

Akobo is now firmly controlled by the rebels, who include large chunks of what used to be the national army, and in the central market there is a sense of something approaching normality. But few expect it to last. Koang Rambang, 37, the county commissioner, predicts famine and even genocide. “Akobo is the first town the government are targeting because they consider it a supply route and escape route for the community,” he said. “We’ll do our best to make sure citizens are aware of the threats they are facing.”

Talking into a satellite phone and flanked by soldiers wielding guns, Rambang is now firmly in Machar’s camp because, he says, it is the pragmatic choice. “People call us the rebels but this is the resistance movement to the onslaught, the killings by Salva Kiir. I have no interest in rebelling to go running in the bush for no reason. But if someone wants to kill me because I am Nuer, then I have no choice. I am ready for peaceful solution but if people choose to go forcefully, I am also ready for that.”

In predominantly Dinka areas of South Sudan there are similar accounts of brutal treatment at the hands of the Nuers and hostility towards Machar. In Akobo, it is the Dinka president who is deeply unpopular. Rambang, 37, said: “The communities have no trust in Salva Kiir’s leadership. The solution to this crisis is to have Kiir step aside and let some change happen. The other party might want Machar to step aside. I’m sure Machar will compromise because I have spoken to him several times.”

The war has caused a surge in child brides, according to Rambang, with families pushing girls as young as 13 into marriage so they will receive a cattle dowry. But the biggest crisis in Akobo, he says, is food security. Harvests, markets and trade routes have been disrupted. One in three children are acutely malnourished, with consequences including increased vulnerability to malaria and failure to attend school.

The village borders a river where children splash and play and climb trees, exotic blue-and-red birds swoop low and lone canoeists gently push through a surface almost as smooth as glass. It takes 45 minutes on a motorboat to reach the village of Dangjok. Here soldiers stand guard, bullet belts around their shoulders, the Nuer initiation pattern of six parallel horizontal scars on their foreheads. The local chief works at a desk in a gloomy corrugated shed where rocket-propelled grenades litter the floor and bats hang from the wood beams.

Save the Children and a local NGO, Nile Hope, are running an outpatient therapeutic centre where, in a modest building of mud walls and thatched roof, malnourished babies are registered, weighed, measured for height and arm circumference and given the peanut-based paste Plumpy’Nut or, in severe cases, referred to hospital for urgent treatment. Right now the preventative measure appears to be working, with hospital admissions down to single figures.

Nellie James, assistant nutrition coordinator at Nile Hope, said some mothers carry their children for two hours to be here. “None of them give up. These mothers are very strong and very determined. Here in Akobo people value children more. A mother can go two days without eating but the child has to eat.”

Among more than 30 mothers waiting their turn last week was Nyanhial Ruot, who fled the city of Malakal nine months ago. She was on the main street when government tanks opened fire. “Children were crying,” she recalled, wearing a rainbow coloured dress, sandals and yellow headscarf patterned with a red rose. “I’ve seen people dying in front of me. Most of them were mothers and children who were not able to run. We turned left and that’s why we’re alive. Those running in front were killed.”

Ruot, 25, and her family trekked for two months to reach Dangjok, but now her four-year-old daughter and two-year-old son are suffering vomiting and diarrhoea. “I’m worried about my children’s lives,” she said. “Before the crisis we got medicine in the market. Now there is none or the prices have gone up.”

A small paracetamol tablet has risen in price from 10 to 25 South Sudanese pounds (roughly $3 to $8), she complained. Food is also scarce. “We have planted some sorghum and maize but there is not enough for the children. In the dry season we collect fruits, grasses and leaves.”

That Ruot and hundreds of mothers like her are receiving help, and that South Sudan is not yet officially in famine is a notable victory for the aid agencies. Ultimately, however, it is only a sticking plaster. One in seven people are still at food crisis or emergency level and 50,000 children could die by the end of the year. All the good work could be undone if Kiir and Machar fail to make peace, or are not compelled to do so. The Enough Project has called for punitive measures including seizing the homes, bank accounts and shell companies of anyone undermining the peace process.

Tariq Reibl, head of Oxfam’s programme in South Sudan, said: “If famine comes to South Sudan it will come through the barrel of a gun. This is a man-made crisis, not one caused by the vagaries of the weather, and though humanitarian aid is vital it cannot fix a political problem.

“The international community is much better at saving lives than it is at helping solve the political problems that put lives in peril. Nine months of the softly-softly approach to peace negotiations has failed. If the international community really wants to avert a famine then it has to make bold diplomatic efforts to bring both sides to end the fighting.”