He said: "This is a political crisis and urgently needs to be dealt with through political dialogue. There is a risk of this violence spreading to other states... [and] we have already seen some signs of this."

Mr Ban confirmed that some 20,000 people had taken refuge in the UN mission in Juba.

The mayor of Bor, Nicholas Nhial Majak, told the BBC's Focus on Africa programme that violence had spread there from Juba, where it began on Sunday. Bor is about 150km (90 miles) north of the capital.

The mayor said troops loyal to breakaway army commander Peter Gadet had raided the town and there was "a lot of fighting".

"There is a lot of panic in town - and we really want the authorities to send more troops to quickly restore hope for the people," he said.

Media playback is unsupported on your device

Media captionThe UN says up to 20,000 people have taken refuge in their mission in Juba

The South Sudan Red Cross Society said at least 19 people were killed in fighting there.

Joe Contreras, spokesman for the UN Mission in South Sudan (UNMISS), said: "Hundreds of civilians have been streaming into our camp on the outskirts of the town, they're now over the 1,000 mark, and Bor is very tense."

One witness in the town saw a police guard shot dead and said that rebel troops had raided the police and prison headquarters, and blocked the road to Juba.

Profile: Riek Machar

Image copyrightAPImage caption
Riek Machar was reportedly dismissed by President Kiir as part of a power struggle

Central figure in Sudanese and South Sudanese politics for three decades

Member of South Sudan's second-largest ethnic group, the Nuer

Married UK aid worker Emma McCune in 1991 - she died two years later in a car accident in Kenya while pregnant

Was a Sudan People's Liberation Movement (SPLM) commander and led a breakaway faction for some years in the 1990s

After 2005 peace deal appointed vice-president of interim government, retaining the post after independence in 2011 until his dismissal in July 2013

South Sudan military spokesman Col Philip Aguer admitted that "we don't know who is fighting who" in Jonglei state.

The UN has expressed fears of a civil war between the two main ethnic communities, the Dinka - Mr Kiir's group - and the Nuer, from which Mr Machar hails.

Gunfire continued in Juba in the early hours of Wednesday but the city was later reported to be quieter.

Businessman Muhammad Waqas ur-Rehman told the BBC the city was tense and that he and many others were trying to leave.

Presidential spokesman Ateny Wek Ateny told the BBC that government forces were in full control of Juba and all other cities, and that although there were "pockets of resistance", there were no major engagements taking place.

Mr Ateny played down the prospect of civil war and said that while it was likely that civilians had been caught in the fighting, no-one was "targeting ethnic groups".

BBC world affairs correspondent Mike Wooldridge says it remains to be seen what impact such government assurances will have in what has been a tense and volatile situation.

The UK's Foreign Office said it was pulling some of its embassy staff out of Juba "due to the current instability".

Image copyrightReutersImage caption
People gather at Juba airport to catch flights out

It said the embassy remained open but that it now advised "against all travel to Jonglei state and Juba".

The US has suspended embassy operations and on Wednesday flew out 120 evacuees, including 28 foreign diplomats, on two C-130 aircraft.

South Sudan Information Minister Micheal Makuei Lueth confirmed to the Associated Press that at least 500 people, mostly soldiers, had been killed "in the bushes" around Juba.

He said up to 700 more had been wounded.

Earlier Mr Machar denied allegations that he had tried to stage a coup.

He told the BBC World Service's Newsday programme: "Salva wanted to frame me. I had to flee. They are hunting me down."

The whereabouts of Mr Machar are unclear. He told the BBC he was still in South Sudan and was "not going to leave the country".

He blamed Sunday's fighting on a conflict between members of the presidential guard.

He added that government troops had used the incident to arrest some of his supporters.

Mr Kiir said a group of soldiers supporting Mr Machar had tried to take power by force on Sunday night but were defeated.

South Sudan has struggled to achieve a stable government since becoming independent from Sudan in 2011.

The oil-rich country remains ethnically and politically divided, with many armed groups active.

After a peace deal was signed in 2005, Mr Machar was appointed vice-president of the South Sudan regional government.

He retained the position after independence in 2011 but was dropped in July when the whole cabinet was sacked.

Image caption
Both Sudan and the South are reliant on oil revenue, which accounts for 98% of South Sudan's budget. They have fiercely disagreed over how to divide the oil wealth of the former united state - at one time production was shutdown for more than a year. Some 75% of the oil lies in the South but all the pipelines run north.

Image caption
The two Sudans are very different geographically. The great divide is visible even from space, as this Nasa satellite image shows. The northern states are a blanket of desert, broken only by the fertile Nile corridor. South Sudan is covered by green swathes of grassland, swamps and tropical forest.

Image caption
Sudan's arid north is mainly home to Arabic-speaking Muslims. But in South Sudan there is no dominant culture. The Dinkas and the Nuers are the largest of more than 200 ethnic groups, each with its own languages and traditional beliefs, alongside Christianity and Islam.

Image caption
In the Sudanese states of Khartoum, River Nile, and Gezira states, two-thirds of people have access to piped drinking water and pit latrines. In South Sudan, boreholes and unprotected wells are the main drinking sources. More than 80% of South Sudanese have no toilet facilities.

Image copyrightAFPImage caption
Conflict and poverty are the main causes of food insecurity in both countries. In Sudan, many of the residents of war-affected Darfur and the border states of Blue Nile and South Kordofan depend on food aid. The UN said about 2.8m people in South Sudan would require food aid in 2013.

If you are happy to be contacted by a BBC journalist please leave a telephone number that we can
contact you on. In some cases a selection of your comments will be published, displaying your name as
you provide it and location, unless you state otherwise. Your contact details will never be published.
When sending us pictures, video or eyewitness accounts at no time should you endanger yourself or others,
take any unnecessary risks or infringe any laws. Please ensure you have read the terms and conditions.