FIGHTING between opposing ethnic military groups in South Sudan has spread from the capital to the rural state of Jonglei as the death toll has reached 500.

A South Sudanese military spokesman said troops in Jonglei, the largest state in South Sudan, clashed overnight.

About 20,000 people have sought refuge at UN facilities in Juba, the capital, since fighting started on Sunday and the US has ordered its citizens to leave the country immediately.

Diplomats said the UN had reports of between 400 and 500 people killed and up to 800 wounded in the nation that declared independence in 2011 from Sudan, after decades of civil conflict.

President Salva Kiir said in an address to the nation he had foiled a coup attempt by a group of soldiers loyal to former vice-­president Riek Machar, who is now the subject of a manhunt by Sudan's military.

Foreign Minister Barnaba Marial Benjamin said Mr Machar, who has deined the coup claims, is believed to have fled Juba and the government believes he is in hiding.

Mr Benjamin said: "If he wants to become president, he needs to wait for elections. He wants to be president, but in the wrong way."

At least 10 political leaders have been arrested over their roles in the coup.

The clashes are pitting soldiers from the majority Dinka tribe of Mr Kiir against those from Mr Machar's Nuer ethnic group.

Casie Copeland, the South Sudan analyst for the International Crisis Group, said key Nuer leaders in the army are defecting in Jonglei, in an escalation of the conflict.

She said: "The situation is no longer contained to Juba. This extension of conflict to the state-level is deeply concerning and poses serious challenges for ongoing efforts to reduce hostilities."

Tension had been mounting in South Sudan since Mr Kiir fired Mr Machar as his deputy in July, sparking concerns about possible tribal clashes.

Mr Machar said if the country is to be united it cannot tolerate a "one man's rule or it cannot tolerate dictatorship". His removal, part of a wider dismissal of the entire cabinet, followed reports of a power struggle within the ruling party.

The coup attempt took place on Sunday when some soldiers raided the main army barracks' weapons store in Juba but were repelled by loyalists, sparking gunfights across the city. The government has given few details, raising questions about what sparked the violence.

South Sudan has been plagued by ethnic violence since it peacefully broke away from Sudan in 2011 after decades of civil war.

A broader conflict could threaten vital aid and be exploited by neighbouring Sudan, which has had persistent rows with Juba over their undefined borders, oil and security. That would further hurt efforts to build a functioning state in the south.

In Juba, residents reported a tense calm after sporadic gunfire overnight, with traffic returning to the streets.

But the US State Department said it was organising evacuation flights and Britain said it was gathering the names of any citizens who wanted to leave. Other Western nations were expected to follow. Many aid workers live and work in Juba.

Mr Kiir had said before the clashes his rivals were reviving rifts that provoked infighting in the 1990s.

He has faced public criticism for doing little to improve life in one of Africa's poorest nations.