South Sudan's President Salva Kiir has declared a "unilateral ceasefire and cessation of hostilities", and ordered government troops to "disengage" from fighting rival forces loyal to Vice President Riek Machar, following days of violence that left hundreds dead.

The order, which was announced on Monday by presidential spokesman Ateny Wek Ateny, was quickly reciprocated by Machar, who ordered his troops to stop fighting as of 17:00 GMT.

"The president talked to Machar ... they have talked about controlling their forces in an attempt to salvage what has remained of the peace agreement," Ateny said in an interview with Al Jazeera.

Monday witnessed some of the heaviest fighting between the two sides, after clashes erupted on Thursday.

The announcement of a ceasefire came as United Nations Secretary-General Ban Ki-moon called on the Security Council to impose an "immediate arms embargo" on the world's youngest independent state.

READ MORE: What's gone wrong in South Sudan?

Ban said he is "appalled by the indiscriminate attacks" on civilians, and condemned the "failed leadership" in the country, warning that some of the violence committed "may constitute a war crime.

"Yet again, the leaders of South Sudan have failed their people. Rarely has a country squandered so much promise so quickly," he said angrily from the UN headquarters in New York.

Earlier on Monday, renewed clashes broke out in the capital, forcing thousands of civilians to flee and raising fears of a slide back into all-out conflict in the five-year-old country.

At least 272 people have been killed in the recent violence, a health ministry source told the Reuters news agency on Sunday.

"As soon as the ceasefire was announced, everything fell silent," except for a brief celebratory gunfire, according to Al Jazeera's John Hendren, reporting from the capital.

Cancelled anniversary celebration

Following a localised firefight between rival military factions on Thursday night in Juba, major fighting broke out on Friday outside the presidential compound as President Kiir was meeting with Machar, a former rebel leader and currently first vice president.

The fighting quickly spread throughout the city. On Monday, the celebration marking the fifth anniversary of independence has been cancelled.