* U.N. says up to 500 killed so far
* African mediators in talks with president
* President and former vice president from rival clans (Adds Obama comments in paragraphs 2, 11-12)
By Carl Odera and Andrew Green
JUBA, Dec 19 (Reuters) - South Sudanese government troops battled to regain control of a flashpoint town and sent forces to quell fighting in a vital oil producing area on Thursday, the fifth day of a conflict that has deepened ethnic divisions in the two-year-old nation.
The conflict, which has so far killed up to 500 people, has alarmed South Sudan's neighbours. African mediators held talks with President Salva Kiir on Thursday to try to broker peace, and U.S. President Barak Obama urged the clashing factions to stop fighting.
The clashes that erupted around the capital Juba on Sunday night have quickly spread, pitting loyalists of the former Vice President Riek Machar, a Nuer, against Kiir, a member of the dominant Dinka clan.
Machar, whose dismissal in July led to months of tensions, has denied Kiir's accusation that he had led a coup attempt.
Rivals have fought fierce gunbattles over the town of Bor, north of Juba, the scene of a 1991 massacre by soldiers loyal to Machar of hundreds of Dinkas.
Thousands of people have sought refuge in U.N. bases, including 200 oil employees in a main crude-producing region. U.N. officials said one base in Jonglei state, where Bor is located, was breached by Nuer and there may have been deaths.
The fighting adds new instability to an already volatile region of Africa, derailing the young and undeveloped nation's halting efforts to build a functioning state.
A team of mediators sent by the Addis Ababa-based African Union arrived in Juba for talks. An Ethiopian official said representatives were from Ethiopia, Kenya, Uganda and Rwanda, the first major peace initiative since clashes first erupted.
"The African Union is until now meeting with the president," spokesman Ateny Wek Ateny said, without giving details of the team. "Their message is that they are trying to broker peace between the two forces."
Ateny said Bor was in the hands of Machar's forces. "Bor has surrendered actually because the forces that were in Bor were mainly loyal to Machar," he said. "They control the town but government forces are trying to retake the town."
In Washington, Obama issued a statement saying the conflict threatened to derail progress South Sudan has been making since gaining independence.
"Inflammatory rhetoric and targeted violence must cease," Obama said. "All sides must listen to the wise counsel of their neighbors, commit to dialogue and take immediate steps to urge calm and support reconciliation."
Jodi Jonglei Boyoris, a senior official in Juba, said his family were trapped in Bor and were trying to reach a U.N. camp for safety.
"There is no fighting at all because those soldiers who were in Bor town evacuated as of this morning," he said.
U.N. diplomats have estimated between 400 and 500 dead in the clashes and say about 20,000 people have flocked to the bases of U.N. peacekeepers for refuge. But the United Nations says its 7,000 to 8,000 peacekeepers will not intervene in the conflict.
A U.N. base in Akobo in Jonglei state was attacked on Thursday and the United Nations received reports that some people had been killed, Deputy U.N. Secretary-General Jan Eliasson said. "The situation in Jonglei has deteriorated," he said.
A U.N. spokesman said the 200 or so oil workers who fled to a U.N. base in the Bentiu oil-producing area were expected to be evacuated by their company, which he did not name.
Mabek Lang De Mading, deputy governor of Unity State, one of the main oil-producing areas, said forces were sent to Unity field, where five people were killed after workers fought with spears and sticks, and to Thar Jath field, where 11 were killed.
"It is stable now," he told Reuters.
China National Petroleum Corp, India's ONGC Videsh and Malaysia's Petronas are the main firms running the oilfields. Total has exploration acreage in country. South Sudan, a nation the size of France, has the third-largest reserves in Sub-Saharan Africa after Angola and Nigeria, according to BP.
Oil production, which had been about 245,000 barrels per day, supplies the government with most of its revenues.
As tension in South Sudan mounted following the sacking of Machar, the former vice president said Kiir was acting like a dictator. The president said his rivals were reviving the splits of 1991 that led to bloodshed.
South Sudan declared independence from Sudan in 2011. A persistent dispute with Sudan over their border, oil and security have added to the sense of crisis.
The row led to the shutting of oil production for about 15 months until earlier this year, slashing state revenues and undermining efforts to improve public services in a nation of 11 million people but with barely any paved roads. (Additional reporting by Drazen Jorgic in Nairobi and Mark Felsenthal in Washington; Writing by Edmund Blair; Editing by George Obulutsa, Rosalind Russell and Eric Walsh)