(Adds U.S. comment, details)
By Michelle Nichols
UNITED NATIONS, July 26 (Reuters) - The United Nations warned South Sudan's President Salva Kiir on Tuesday that any political appointments must be consistent with a peace deal that ended nearly two years of civil war after Kiir replaced his vice president and rival Riek Machar.
Machar left the South Sudanese capital Juba earlier this month after an eruption of violence in the city when forces loyal to Kiir and Machar battled each other for several days with tanks, helicopters and other heavy weapons.
An August peace agreement states that the vice president must be chosen by the South Sudan Armed Opposition. Machar was sworn in as vice president in April.
However, Kiir replaced Machar on Monday with General Taban Deng Gai, a former chief opposition negotiator who has broken ranks with Machar and has the support of some other opposition members.
"Any political appointments need to be consistent with the provisions outlined in the peace agreement," U.N. spokesman Farhan Haq told reporters in New York on Tuesday.
U.S. State Department spokeswoman Elizabeth Trudeau said some members of the South Sudanese opposition had met in Juba on Saturday and agreed to appoint Deng Gai as vice president.
"In terms of this and whether it's allowed under the peace agreement is going to be a question for the leadership of South Sudan," Trudeau told reporters.
Kiir's appointment of Deng Gai - a former minister of mining - came after Kiir issued an ultimatum last week, demanding that Machar contact him within 48 hours and return to Juba to salvage the peace deal, or face replacement.
Deng Gai, who was the chief negotiator for Machar's SPLM-IO group during the peace talks, and some other opposition members backed Kiir's ultimatum. Machar said on Friday he had fired Deng Gai 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.
Machar has said he would only return to Juba after international troops were deployed as a buffer force to separate his forces from Kiir's.
South Sudan, which gained independence from Sudan in 2011, descended into civil war after Kiir fired Machar as vice president for the first time in 2013. More than 10,000 people were killed and some 2 million displaced, many of whom fled to neighboring countries.
(Additional reporting by David Alexander; Editing by Jonathan Oatis and Tom Brown)
Our Standards: The Thomson Reuters Trust Principles.