South Sudan’s President Salva Kiir says an attempted coup by disgruntled soldiers has been put down.
It comes after heavy gunfire overnight in the capital, Juba, reportedly between rival factions of the presidential guard.
Kiir told reporters in the capital that the government was in full control and announced a night time curfew.
The UN has expressed concern and appealed for calm. It said it was in touch with the government.
Hilde Johnson, the special representative in the country, said she was “deeply concerned” and urged “all parties in the fighting to cease hostilities immediately and exercise restraint”.
“I have been in touch regularly with the key leaders, including at the highest levels to call for calm,” she said.
‘Justice will prevail’
Tensions have been high in South Sudan – the world’s youngest country – since President Kiir dismissed his entire cabinet, including his deputy Riek Machar, in July in an apparent power struggle.
Machar had indicated he planned to contest the presidential elections in 2015.
Kiir is from the Dinka community, which is the largest in South Sudan, while Machar is from the Nuer, the second-largest. Some Nuer have complained about Dinka political domination.
The fighting in Juba broke out overnight, and intensified in the early morning.
There were reports of continuous gunfire and the sound of explosions. The city’s airport has been closed and the state TV channel SSTV went off air.
Speaking to reporters in Juba – wearing military uniform rather than his usual civilian clothing – Mr Kiir said an attempted coup had been put down.
He said the fighting began when unidentified uniformed personnel opened fire at a meeting of the ruling party and former rebel group, the Sudan People’s Liberation Movement (SPLM).
He said the government was pursuing the attackers and that justice would prevail.
The SPLM would never allow power to be transferred by force in South Sudan, he said.
The UN-backed Radio Miraya said four children had been wounded, two critically.
Some 400 people, mainly women and children, had taken shelter at the UN compound in Juba, it reported.
The situation had reportedly calmed by mid-morning, but heavily armed troops were seen on the capital’s streets.
One resident who lives near the presidential guard barracks told the BBC that many people had sought refuge at a Catholic church.
The U.K and US embassy in Juba urged their citizens via Twitter to stay indoors and exercise caution.
The US embassy also denied rumours that Machar had taken shelter there.
In a statement, the US said embassy staff had spoken to a range of officials and concerned parties “in order to urge calm, restraint, and a settling of differences through a peaceful political means rather than through violence”.
South Sudan formally split from Sudan in 2011, after decades of conflict. But the oil-rich country is ethnically and politically divided, with many armed groups active.