* 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 (Add foreign ministers' visit, State department comment)
By Andrew Green
JUBA, Dec 18 (Reuters) - South Sudan's president said on Wednesday he was ready for dialogue with his former vice president Riek Machar, whom he has accused of orchestrating fighting that has killed up to 500 people and brought the fledgling nation close to civil war.
Clashes that erupted in Juba late on Sunday spread on Wednesday to the flashpoint town of Bor, north of the capital and scene of an ethnic massacre in 1991, raising fears of slide back into conflict between clans.
President Salva Kiir, a member of the dominant Dinka, has blamed the clashes on Machar, a Nuer, who he sacked in July, and said he was plotting a coup. But Kiir told a news conference he was ready for dialogue.
"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.
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 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.
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.
The president sacked Machar in July and political tensions have been simmering since. South Sudan, which declared independence from Sudan in 2011, produces oil but fighting has so far appeared to stay away from the oilfields.
The government said it had arrested 10 people, including seven former ministers, over a "foiled coup" and wanted to question several others, including Machar.
In Bor, where Nuer soldiers loyal to Machar massacred hundreds of Dinka in 1991, locals feared the fighting could spill beyond two nearby barracks, where clashes flared.
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.
RAISING THE STAKES
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.
"Last night there was fighting in two military barracks," Hussein Maar, deputy governor of Jonglei state, told Reuters, although the town of Bor was calm, he said.
A journalist in Bor told Reuters troops led by Peter Gadet, a Machar ally, took control of the two bases from Dinka soldiers. But details were sketchy and, according to another account, only one base was taken over.
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.
The former vice president has said he would run for president and has accused Kiir of being dictatorial.
Kiir had said before the clashes that his rivals were reviving rifts that provoked infighting in the 1990s.
He has faced mounting public criticism for doing little to improve life in one of Africa's poorest nations. (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 Sonya Hepinstall)