The UN has warned South Sudan's President Salva Kiir that any political appointments must be consistent with a peace deal that ended nearly two years of civil war.

The warning came a day after Kiir replaced his vice president and rival Riek Machar with Taban Deng, in a move that could potentially undermine August's peace agreement and send the world's youngest country back to all-out conflict.

Inside Story - What's hampering peace in South Sudan?

"Any political appointments need to be consistent with the provisions outlined in the peace agreement," UN spokesman Farhan Haq told reporters in New York on Tuesday.

Machar left the South Sudanese capital, Juba, earlier this month after an eruption of violence in the city when forces loyal to him and Kiir battled each other for several days with tanks, helicopters and other heavy weapons.

Hundreds of people, mostly soldiers, were killed in the fighting, raising fears of a slide back into civil war.

Kiir's appointment of Deng came after the president issued an ultimatum last week, demanding that Machar contact him within 48 hours and return to Juba to salvage the peace deal - under which the vice president must be chosen the South Sudan Armed Opposition - or face replacement.

DENG INTERVIEW: Machar missing, I'm ready to fill S Sudan vacuum

Deng, a former mining minister and the chief negotiator for Machar's SPLM-IO group during the peace talks, backed Kiir's ultimatum. Machar said on Friday he had fired Deng and accused him of defecting to Kiir's party.

"We call on all parties to ensure that the ceasefire is maintained and that any divisions within the opposition or between the parties be dealt with peacefully through dialogue," Haq said.

Ruinous conflict

South Sudan was founded with optimistic celebrations in the capital on July 9, 2011, after it gained independence from Sudan in a referendum that passed with close to 100 percent of the vote.

The country descended into conflict in December 2013 after Kiir accused Machar, his former deputy who he had sacked earlier that year, of plotting a coup.

Civil war broke out when soldiers from Kiir's Dinka ethnic group disarmed and targeted troops of Machar's Nuer ethnic group. Machar and commanders loyal to him fled to the countryside, and tens of thousands of people died in the conflict that followed. Many starved to death.

A peace agreement signed in August saw Machar rejoin the goverment and his forces re-enter Juba as the first step towards integration into a national army.

Source: Al Jazeera and agencies