A South Sudanese general has resigned while telling President Salva Kiir "you have disgraced yourself" by subjecting the civil war-torn country to ethnic bias and "unacceptable cycles of violence."

The resignation letter, dated Saturday and seen by The Associated Press, comes from Lt. Gen. Thomas Cirillo Swaka, the deputy chief of general staff for logistics. Government spokesmen could not immediately be reached.

Warnings of genocide hang over South Sudan, where a 2015 peace deal has failed to stop the three-year civil war.

Swaka's letter accuses the president of a "policy of ethnic domination and subjugation" in which Kiir's ethnic Dinka group "has come to be hated by their own brothers and sisters from other communities."

South Sudan's civil war has killed tens of thousands and forced 1.5 million to flee.