South Sudan clashes
A young boy, injured while fleeing from clashes, rests at a medical clinic inside the United Nations compound on the outskirts of the capital Juba in South Sudan Reuters

The clashes between rival army factions in South Sudan are said to have killed up to 500 people, say UN officials, amid fears the fight could stoke ethnic conflict in the world's newest country.

UN diplomats in the capital Juba, citing unconfirmed reports, have said hundreds of bodies have been piled up in two hospitals.

"Two hospitals have recorded between 400 and 500 dead and [up to] 800 wounded," said a diplomat in New York, citing information shared in a closed-door gathering, Reuters reports.

The landlocked country in central Africa has witnessed two days of violence. President Salva Kiir said the government has foiled a "coup attempt" led by ousted vice-president Riek Machar.

The authorities have detained at least 10 senior politicians - most of them former ministers - in connection with the clashes. The police are also hunting for five more senior figures including Machar.

"Those who are still at large will be apprehended. According to our sources, some of them have moved out of Juba town towards the Terekeka areas, north of the capital Juba, probably with the intention of moving towards the base of Dr. Riek [Machar]," government spokesperson Michael Makuei told reporters.

Meanwhile, officials have warned the volatile situation could fuel ethnic violence between two main groups, Dinka and Nuer, across the oil-rich nation.

"At a time when unity among South Sudanese is more needed than ever, I call on the leaders of this new country and all political factions and parties, as well as community leaders to refrain from any action that fuels ethnic tensions and exacerbates violence," Hilde Johnson, Special Representative of the United Nations Secretary-General, said in a statement.

The government has, however, denied any such ethnic tensions but urged the public not to make provocative remarks.

"There are people out there saying what has happened is between the Dinka and the Nuer tribesmen. We the leaders of this country would want to state here that this is not true. If you see the people going with Dr Riek [Machar], some are Dinkas, some are Chol, Nuer and other tribes," said the Governor of Unity State, Simon Kun Pouch.