NAIROBI, Kenya — President Salva Kiir of South Sudan, facing the threat of “immediate action” by the United Nations if he did not endorse a proposed peace deal, signed an accord with rebels on Wednesday aimed at ending nearly two years of conflict marked by widespread atrocities.
Since the start of the civil war in 2013, at least eight peace deals have collapsed before taking effect, and clashes between the warring factions were reported around the country even as the latest accord was completed.
President Obama and regional leaders threatened recently to expand international sanctions and impose an arms embargo if the rival factions did not sign a peace deal.
The civil war in South Sudan, the world’s youngest nation, was set off by a power struggle between Mr. Kiir and his former deputy, Riek Machar. It quickly devolved into a battle fought largely along ethnic lines, pitting the Dinka ethnic group, which backs Mr. Kiir, against the Nuer, who support Mr. Machar.
Mr. Machar signed the peace accord in Addis Ababa, Ethiopia, on Aug. 17, but Mr. Kiir refused, condemning it as unfair and unsustainable. Confronted with widespread international pressure and the threat of an arms embargo, Mr. Kiir relented on Wednesday.
South Sudan gained independence from Sudan in 2011 after decades of warfare, but the situation began to deteriorate less than two years after the state was created.
More than 2.2 million people have been displaced, with about 200,000 seeking refuge at United Nations bases that were not equipped to handle the sudden flood of humanity.
Fighters on both sides of the conflict have been accused of committing atrocities and gross violations of human rights.
The country’s third-largest ethnic group, the Shilluk, have also been drawn into the fighting, first on the side of the government but more recently aligned with the rebels. The attempt to establish peace might be further complicated by the recent splintering of rebel forces, with several commanders breaking from Mr. Machar.
In a report presented to the United Nations Security Council, a panel of experts documented a pattern of crimes against humanity, including the use of rape as a weapon of war, widespread pillaging and targeted attacks on civilians that included burning people alive in their homes.
“The intensity and brutality of violence aimed at civilians is hitherto unseen, in what has been so far — without a doubt — an incredibly violent conflict, where civilians have been targeted by all parties to the conflict,” the experts wrote in the interim report.
The conflict has been one of the deadliest in the world for aid workers, with 31 killed and scores missing. This week, Doctors Without Borders said two of its local staff members had been killed.
Gawar Top Puoy, a logistician, and James Gatluak Gatpieny, a community health worker, died in separate attacks in Unity State near the town of Leer, once a rebel stronghold.
“We’re deeply shocked and saddened by the killings of our colleagues,” said Tara Newell, the organization’s emergency manager. “The situation is desperate. Ongoing attacks, killings and sexual violence against civilians by any armed actor in Unity State must stop.”
According to the United Nations report, the government’s offensive in Unity between April and July was “intent on rendering communal life unviable and prohibiting any return to normalcy following the violence.”
A Security Council resolution drafted by the United States called for an arms embargo to be put in place against the South Sudan government by Sept. 6 if Mr. Kiir did not sign the peace deal, or if it is not carried out by both parties. The future of that resolution is unclear.
In its report to the United Nations, the panel found that both the government and rebels had devoted vast resources to the conflict. Soon after the outbreak of fighting in 2013, the report found, the government earmarked about $850 million to crush a rebellion.
The supply of Israeli automatic rifles, Chinese missiles, Russian attack helicopters and amphibious vehicles “has been instrumental in prolonging and escalating the war” and enabled large-scale violations of humanitarian law, the panel found.