Top United Nations rights officials vowed Wednesday to do everything in their power to prevent conflict-wracked South Sudan from sliding into genocide, and warned the warring factions they would be held responsible if famine breaks out.

Firing off a damning attack against South Sudan’s President Salva Kiir and rebel leader Riek Machar, the UN’s High Commissioner for Human Rights Navi Pillay said she was “appalled by the apparent lack of concern about the risk of famine displayed by both leaders.”

The comments came after Pillay, accompanied by a special genocide envoy, held talks with the rival leaders, and a day after the UN made a desperate appeal for a one-month truce to avert a famine and humanitarian disaster.

“To the survivors of the genocide, we owe a pledge to take all possible measures within our power to protect populations from another Rwanda, there is no excuse for inaction,” UN envoy for the prevention of genocide Adama Dieng told reporters.

“It is clear that the conflict has taken a dangerous trajectory, and civilians are being deliberately targeted based on their ethnicity and perceived political affiliation,” he said in a joint news conference with Pillay.

The four-month-old civil war in South Sudan, which only won independence from Sudan in 2011, has already left thousands of people dead — and possibly tens of thousands — with at least 1.2 million people forced to flee their homes.

A ceasefire signed in January is in tatters, with tens of thousands of people sheltering in UN bases following a wave of ethnic massacres and other war crimes including rapes, the forced recruitment of children and killings in hospitals, churches and mosques.

“The deadly mix of recrimination, hate speech, and revenge killings that has developed relentlessly over the past four and a half months seems to be reaching boiling point,” Pillay said.

She said there were now some 9,000 children fighting in the country on both sides.

– Risk of famine –

“The country’s leaders, instead of seizing their chance to steer their impoverished and war-battered young nation to stability and greater prosperity, have instead embarked on a personal power struggle that has brought their people to the verge of catastrophe,” she said.

“The prospect of widespread hunger and malnutrition being inflicted on hundreds of thousands of their people, because of their personal failure to resolve their differences peacefully, did not appear to concern them very much.”

She warned Kiir and Machar that “if famine does take hold later in the year… responsibility for it will lie squarely with the country’s leaders, who agreed to a cessation of hostilities in January and then failed to observe it themselves.”

Dieng also called on Kiir and Machar to take “higher responsibility” for those under their command.

The UN visit, which wrapped up Wednesday, comes as US Secretary of State John Kerry is also heading to the region.

The United States was instrumental in helping South Sudan gain independence, and Kerry, who arrives in Ethiopia late Wednesday, is expected to try to press the negotiators at slow-moving peace talks to end the fighting.

Earlier this month, the rebels were blamed for the killings of hundreds of people in the oil hub of Bentiu, and a pro-government mob killed dozens of civilians in an attack on a UN base in Bor.

The unrest broke out on December 15 in what Kiir called a coup attempt by Machar, his sacked vice president. The conflict has taken on an ethnic dimension, pitting Kiir’s Dinka tribe against militia forces from Machar’s Nuer people.

Dieng said the country “should not be led down this slippery slope”.

“I beseech everyone, the South Sudanese, your leaders, the regional and international community, to take immediate measures to end the violence and uphold our collective responsibility to protect the populations of South Sudan from genocide, war crimes, ethnic cleansing and crimes against humanity.”

Last week the UN Security Council brandished the threat of sanctions against both the rebels and government forces.

UN Secretary General Ban Ki-moon is “strongly concerned, and will make sure that never again what happened in Rwanda happens in another place in this continent,” Dieng said, adding that “the world is watching.”