The President of South Sudan, Salva Kiir, says he has defeated a coup attempt following a night of fierce fighting between rival troops in the capital Juba.
The clashes broke out in a barracks close to the city center shortly before midnight and spread across the city, diplomats and witnesses said, adding that heavy machine guns and mortars were heard.
Salva Kiir blamed troops loyal to his arch-rival and former vice president, Riek Machar, for starting the attempted coup. Machar was sacked from the government in July.
"Your government is in full control of the security situation in Juba. The attackers fled and your forces are pursuing them. I promise you justice will prevail," Kiir told the people of South Sudan in a speech.
"I will not allow or tolerate such incidents once again in our new nation. I strongly condemn these criminal actions in the strongest terms possible," said Kiir, who was dressed in military uniform rather than his trademark suit and cowboy hat.
He said an overnight curfew would be imposed from 6:00 pm to 6:00 am, and would remain in force until further notice.
Machar leads a dissident group within South Sudan's ruling party, the Sudan People's Liberation Movement (SPLM), and is seen as the main challenger to Kiir.
UN appeals for calm
The United Nations said hundreds of terrified civilians had sought refuge in a UN compound, while across the city most residents locked themselves in their homes or tried to flee to safer areas.
The UN said it was "deeply concerned" over the fighting and that was in contact with South Sudan's leadership. "As the special representative of the secretary general I urge all parties in the fighting to cease hostilities immediately and exercise restraint," UN Special Representative Hilde Johnson said in a statement.
A spokesman for the UN mission in South Sudan, UNMISS, said hundreds of civilians had sought shelter at their compound.
"We have more than 800 civilians who came into our compound adjacent to the airport, mostly women and children. Among them are seven wounded, including a two-year-old boy in a critical condition," Joseph Contreras told AFP.
Statements from the US and British embassies in Juba urged their nationals to avoid unnecessary movements. The US embassy said there had been "incidents and sporadic gunfire in multiple locations across Juba" throughout the night.
Power struggle within the SPLA
Oil-rich but impoverished South Sudan won its independence in 2011 after its people voted overwhelmingly in a referendum to split from the north and form a new nation.
But the country has struggled with ethnic violence and corruption, and political tensions have worsened in recent weeks.
Earlier this month key SPLM leaders including Machar and Rebecca Garang, the widow of South Sudan's founding father John Garang, made a public challenge to Kiir, accusing him of being "dictatorial".
A diplomat in the city said troops loyal to the president had been posted at major intersections. Civil aviation and airline sources also said that Juba airport had been shut indefinitely, while the country's borders with Uganda and Kenya were reportedly shut.
James Shimanyula, a DW correspondent and author of two books on South Sudan, says the coup attempt was carried out by soldiers loyal to the former Vice President Riek Machar, who is also suspected to be in close contact with Khartoum.
“At the moment one cannot confirm whether Khartoum played any role in coup attempt, said Shimanyula,"but all signs show that soldiers loyal to Machar are behind the attempted coup."
“The latest coup attempt tells us about the growing tensions in South Sudan since the sacking of Riek Machar and Pagan Amum the former secretary general of the SPLA among others,” Shimanyula added.