Two top officials overseeing South Sudan's military courts have resigned, saying high-level interference made it impossible to discipline soldiers accused of rape and murder amid the nation's civil war.

The resignations of Brigadier General Henry Oyay Nyago and Colonel Khalid Ono Loki, according to a letter seen by various media networks, follow the resignations of a general and the minister of labour earlier this week.

Oil-rich South Sudan has been mired in civil war since 2013 when President Salva Kiir, an ethnic Dinka, fired his deputy Riek Machar, an ethnic Nuer.

Since then, fighting has increasingly fractured the world's youngest country along ethnic lines, leading the UN to warn that the violence was setting the stage for genocide.

Nyago, advocate general and director of military justice, became the latest military official to pen a damning resignation letter, accusing the government of atrocities in the civil war.

"Your regime committed sundry war crimes... genocidal acts and ethnic cleansing," Nyago wrote, accusing Kiir of ordering the killing of civilians not belonging to the Dinka group, and overlooking crimes committed by the Dinka in various probes into violence.

"I cannot continue to be silent or taciturn when you are finishing and slaughtering the innocent people of South Sudan," Nyago said, while detailing specific events in which civilians were ordered killed, or atrocities were overlooked.

In another letter released on Saturday, Loki, the head of South Sudan's military court, accused the army chief of extrajudicial arrests of citizens based on their ethnicity.

Addressed to army chief Paul Malong Awan, the letter decried "unspecified and unstipulated arrests and detentions fluctuating from months to years without investigation and scrutiny ... on fabricated cases against individuals of non-Dinka ethnicity".

OPINION: Save South Sudan from destroying itself

Loki also accused Awan of dismissing rulings against members of his own tribe accused of murder, rape and theft.

Military spokesman Brigadier General Lul Ruai Koang said Loki had resigned last year but that it had not been publicised. He did not comment on reports of human rights abuses by the military and was unavailable for comment on Nyago's resignation.

The government has previously said soldiers who commit abuses are prosecuted. Officials have not provided any figures or details on such cases.

Both Nyago and Loki said soldiers were committing crimes without fear of punishment, particularly officers who were Dinka, the same tribe as the president and chief of army staff.

"Rape cases committed and being committed by your army and organised forces have become a daily game ... you have recruited children compulsorily and ordered killing of war prisoners," Nyago's letter added.

Both Nyago and Loki said the president was protecting soldiers from his own tribe.

There are 15,000 UN peacekeepers in South Sudan, but they have been criticised for not intervening when human rights abuses are being committed.

The conflict has forced more than three million of the nation's 11 million citizens to leave their homes, creating pockets of severe malnutrition.

Last year inflation reached more than 800 percent.