More than two years after rebels in the Central African Republic (CAR) captured the country's capital Bangui and set off a cycle of retribution and ethnic cleansing, 10 groups in the war-torn nation have agreed to lay down their arms.

The agreement, reached Sunday, is the culmination of a national peace forum that began last week in Bangui and included civil society, youth, women, and local representatives. UN Secretary General Ban Ki Moon welcomed the decision and called for "its swift and full implementation."

Last week, the UN's Children Fund (UNICEF) announced it had brokered the release of as many as 10,000 children being employed as combatants, cooks, and sex slaves by armed groups in the country.

The forum also heard calls from the CAR's national election authorities to delay a vote that had been set for later this year. The country is currently governed by the interim administration of President Catherine Samba-Panza. Elections set for February were already pushed back due to insecurity and lack of preparation.

In March 2013, predominantly Muslim Seleka rebels captured Bangui, deposing President Francoise Bozize and replacing him with their leader Michel Djotodia. The Seleka never effectively governed the country — or even Bangui — and instead took to looting and killing. Amid the anarchy, mostly Christian vigilante groups known as the anti-Balaka took up arms to fight the Seleka and committed their own share of atrocities.

In December, as reports emerged of bodies littering the streets of Bangui, the UN Security Council authorized a French intervention force, Operation Sangaris, to augment the African Union's own fledgling and disorganized peacekeeping mission.

The French effectively targeted the Seleka, but were accused by Muslim residents of leaving them to fend for themselves. By mid-2014, a de facto split had taken effect between areas controlled by the ex-Seleka, who had been disbanded in September by Djotodia, and an assortment of anti-Balaka groups.

When the official UN peacekeeping mission in the country, MINUSCA, finally deployed last September, the Muslim population of Bangui, which once stood at 100,000, had largely been driven out. At the time of MINUSCA's deployment, the Associated Press calculated that more than 5,000 people had been already been killed in fighting. Some 900,000 — about a fifth of the country's population — have been forced from their homes.

Samba-Panza's government enjoys only tenuous control over Bangui, and relies on some 10,000 UN peacekeepers and the French troops to police the rest of the country — a territory slightly smaller than the state of Texas. Evan Cinq-Mars, a research analyst at the Global Center for the Responsibility to Protect, an organization that works to prevent crimes against humanity, told VICE News the peacekeepers are spread thin across the expanse.

"MINUSCA and the French don't have full control of the country," Cinq-Mars said. "There are still vast swaths of the country that are under the control of armed groups, whether it's various factions of the ex-Seleka or others."

Sunday's agreement aims to integrate the fighters into the country's armed forces — a formidable task that is anything but guaranteed. Cinq-Mars noted the text excludes anyone accused of "crime of genocide, war crimes, and crimes against humanity" from the amnesty program.

Last year, the International Criminal Court (ICC) opened a probe into abuses committed in the country since 2012.

"The information available provides a reasonable basis to believe that both the Seleka and the anti-Balaka groups have committed crimes against humanity and war crimes including murder, rape, forced displacement, persecution, pillaging, attacks against humanitarian missions and the use of children under 15 in combat," ICC prosecutor Fatou Bensouda said upon opening the probe.

In April, the country's National Transition Council established a separate special criminal tribunal aimed at trying those responsible for atrocities.

The peace forum was held in the shadow of allegations, first published in the Guardian in late April, that French and African peacekeepers raped and sexually abused young children over the course of several months from December 2013 to June 2014. Staff from UNICEF and the UN's human rights division collected testimony from displaced children who were among the thousands camped at Bangui's airport at the time of Operation Sangaris.

Though the UN was not in control of the French force, it has come under fire for its handling of the report, which was leaked to French authorities last July by UN staff member Anders Kompass. The UN later suspended Kompass, who it said had broken protocol by divulging the unredacted document. A UN tribunal reinstated Kompass last week.

French investigators said they were stymied by UN personnel and only received a redacted version of the report on March 30. Kompass told the UN tribunal that the French head of UN peacekeeping, Herve Ladsous, had pushed for his resignation. Ladsous denied those allegations last week at a hastily called press conference, after which he took no questions.

On Friday, Zeid Ra'ad al-Hussein, the UN's High Commissioner for Human Rights, told reporters in Geneva that despite the UN's shortcomings, the French should have acted faster, asking, "How is that nobody knew about these abuses between December and May?"