United Nations chief Ban Ki-moon called Sunday for an immediate end to violence in South Sudan, where the death toll is mounting from fighting between rival forces loyal to the president and his sacked deputy.

"I demand that all political, military and militia leaders stop hostilities and end the violence against the civilians," Ban told a news briefing on a visit to the Philippines.

He called on President Salva Kiir and his rival, former vice-president Riek Machar, to "find a political way out of this crisis" and order their followers to lay down arms.

Earlier, President Barack Obama warned against a coup attempt in a statement made after four US servicemen were wounded when the aircraft they were flying in came under fire on their way to help evacuate American citizens.

"Any effort to seize power through the use of military force will result in the end of longstanding support from the United States and the international community," the White House said Saturday.

Obama stressed that South Sudanese leaders "have a responsibility to support our efforts to secure American personnel and citizens in Juba and Bor", the capital and a rebel-held flashpoint town.

The three CV-22 Osprey aircraft were damaged in the attack, forcing them to divert to Uganda. The wounded were then flown to Nairobi for medical treatment and are now in "stable condition", the Pentagon said.

CV-22 Ospreys are flown by US Air Force Special Operations forces to conduct rescue missions.

The US has also deployed 45 combat-equipped troops to South Sudan to protect its embassy and personnel.

The attack underlined the increasingly dangerous situation in South Sudan, where at least one UN base has also come under attack in recent days - with the deaths of two Indian peacekeepers and possibly dozens of civilians.

The US, Britain, Kenya and Uganda have been evacuating their nationals.

Oil companies have also flown out their employees after the death of at least five South Sudanese oil workers Wednesday.

Oil production accounts for more than 95 per cent of the country's fledgling economy.

South Sudan, the world's newest country, split from Sudan in 2011 after a two-decade civil war that left two million people dead. But it has never been able to heal its own ethnic rivalries.

The fighting has both ethnic and political dimensions, as troops loyal to Kiir, an ethnic Dinka, battle forces backing Machar, a Nuer.

Kiir accuses Machar of having tried to mount a coup, but Machar denies that and claims Kiir is conducting a violent purge.

At least 500 people have been killed in Juba alone in a week of fighting.

Tens of thousands of South Sudanese have fled their homes, many seeking shelter at UN bases amid warnings the impoverished nation was on the brink of all-out civil war.