By Denis Dumo

JUBA (Reuters) - A rift appeared in one of South Sudan's two main rival groups on Friday, raising the prospect of further turmoil after months of fighting, as members of one faction threatened to replace their leader.

A group inside the SPLM-IO movement issued a statement saying its head Riek Machar should return to the capital Juba and carry on his work in the government, or be removed from office.

Machar, South Sudan's Vice President, and his SPLM-IO group, have been caught up with more than two years of on-and-off, ethnically charged fighting with supporters of the country's President Salva Kiir.

Machar left the capital last week after a new outbreak of clashes, saying he would only return when an international body set up a buffer force to separate his forces from Kiir's.

Kiir called on him on Thursday to return to salvage a peace deal, and a faction of Machar's own group, led by mining minister Taban Deng Gai, on Friday said they agreed.

"The decision by the government to give... Machar an ultimatum is entirely in line with its powers," William Ezekiel, spokesman for SPLM-IO faction allied to Gai, said.

"On our side, we want him to show up, otherwise we will replace him."

Machar's spokesman, James Gatdet, rebuffed the threats, saying Gai's faction had no official status in the moment.

South Sudan's politics has long been plagued by splits and rivalries as leaders switch allegiances, in the contest for power and influence in the oil-producing nation, which only emerged from Sudan five years ago.

“Machar ... has communicated to all his military commanders to cut off any communication with General Taban Deng Gai and his few individuals who support the President Kiir's conspiracy," he said.

Speaking after a cabinet meeting attended by some SPLM-IO ministers, Information Minister Michael Makuei said it was up to the party to sort out its internal differences.

"The cabinet has advised (Machar) to put his house in order so that they decide as to whether someone will be acting in the place of Riek Machar or declare his position vacant," he told reporters after the meeting.

The two years of fighting started after Kiir sacked Machar as Vice President in 2013 and has killed more than 10,000 people and displaced over 2 million, many of whom fled to neighboring countries.

The most recent fighting in Juba has forces 26,000 people to flee to neighboring Uganda, the U.N. refugee agency UNHCR's spokesman Andreas Needham told a news conference in Geneva.

(Additional reporting by Stephanie Nebehay in Geneva; Writing by George Obulutsa; Editing by Andrew Heavens)