* Clashes erupt in capital, spread to flashpoint town
* U.S, other Western nations say pulling out citizens
* African foreign ministers to visit to seek end to fighting
* Fighting revives memories of bloody ethnic rifts in 1990s
By Andrew Green
JUBA, Dec 18 (Reuters) - South Sudan's army said it had lost control of the flashpoint town of Bor on Wednesday, its first acknowledged reversal in three days of clashes between rival groups of soldiers that have triggered warnings of a slide into civil war.
President Salva Kiir earlier said he was ready for dialogue with his sacked vice president Riek Machar - the man he accuses of starting the fighting, which diplomats say has killed up to 500 people, and plotting a coup.
But the United Nations said tensions was still spreading across South Sudan's remote states as the violence, which first erupted in the capital Juba late on Sunday, moved north to Bor, the site of an ethnic massacre in 1991.
Witnesses and officials said fighting had broken out in two barracks in Bor between troops loyal to Kiir, from South Sudan's Dinka ethnic group, and Machar, a Nuer, though the reports were sketchy.
"We (are) not in control of Bor town," South Sudan's army spokesman Philip Aguer told Reuters, without going into further details.
"The two main ethnic groups, the Dinka and the Nuer, could go into a full-fledged civil war in the country," Gerard Araud, France's ambassador to the United Nations and current president of the Security Council, told the BBC. He called for dialogue.
Those sentiments were echoed by U.N. Secretary General Ban Ki-moon who said the violence could spread.
South Sudan, which declared independence from Sudan in 2011, remains one of Africa's least developed countries for all its oil reserves, which supply almost all its government revenues and hard currency. Fighting has so far appeared to stay away from the oil fields.
A broader conflict could threaten 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.
MACHAR DENIES COUP
Machar, in an interview with the online Sudan Tribune, denied having any role in the fighting and said he was not behind any coup attempt. He accused Kiir of using clashes that erupted between members of the presidential guard to punish political rivals.
Machar said he was still in South Sudan but did not give details of his location.
The fighting has revived memories of the factionalism in the 1990s within the Sudan People's Liberation Movement - the group that fought Sudan's army in the north for two decades.
Machar led a splinter faction and south-south clashes erupted. Nuer soldiers loyal to Machar massacred hundreds of Dinka in Bor in 1991.
The president sacked Machar in July and political tensions have been simmering since.
Kiir told a news conference on Wednesday he was ready for talks.
"He was asked whether he would accept any dialogue, and he said he is ready for dialogue," presidential spokesman Ateny Wek Ateny told Reuters by telephone. He said Kiir said there was no discussion going on at the moment.
A group of East African foreign ministers will travel to South Sudan on Thursday to seek an end to the fighting, the first foreign mission to enter the country since the eruption of the conflict.
Juba was quiet after sporadic overnight gunfire but U.N. officials also reported fighting in Torit, to the east.
The United Nations says the clashes have driven 20,000 people to its camps for refuge, and that "tensions seem to be on the rise in the other States, such as Unity and Upper Nile".
France's Araud said there were 7,000-8,000 U.N. peacekeepers in South Sudan, but added: "It is clear our soldiers will not intervene in the conflict."
A Western diplomat said the expanded fighting was tipping the nation into an ethnic conflict that was "difficult to roll back", adding Kiir had raised the stakes by calling it a coup.
"It will impact a lot of countries, and they are not beacons of stability," he said of the region around South Sudan.
Uganda temporarily shut its border. Kenya said its border was open, and aid agencies said a refugee camp nearby was braced for new arrivals. Kenya, like other neighbours, hosted Sudanese refugees during former Sudan's long north-south war.
In Juba, traffic returned to the streets and the airport reopened, amid a tense calm in the capital of a nation the size of France, with 11 million people but barely any tarmac roads.
Britain said it was flying out some embassy staff and gathering names of other Britons who wanted to leave. Many aid workers live and work in Juba.
The U.S. State Department said it had evacuated three groups of its citizens on Wednesday, flying them out in two U.S. military C-130 aircraft and one private charter flight.
The Pentagon said it had also bolstered physical security at American diplomatic facilities in Juba.
The U.S. envoy to South Sudan, Susan Page, met Kiir on Wednesday and expressed U.S. concern over the violence and the arrests of opposition politicians.
"We call on the country's political leaders to refrain from any action that could escalate an already tense situation or fuel the violence," State Department spokeswoman Marie Harf said in a statement. "It is absolutely critical that political differences be resolved by peaceful and democratic means."
Diplomats said the United Nations had reports of between 400 and 500 people killed and up to 800 wounded.
"Most people are scared they might be confronted with a mob or see dead bodies," said one aid worker in Juba, after residents awoke to heavy gunfire and artillery blasts on Monday and Tuesday.
(Additional reporting by Drazen Jorgic and George Obulutsa and Noor Ali in Nairobi, Aaron Maasho in Addis Ababa, Louis Charbonneau and Michelle Nichols in New York,Phil Stewart and Arshad Mohammed in Washington D.C., and John Irish in Paris; Writing by Edmund Blair; Editing by Andrew Heavens and Sonya Hepinstall)