ROME (AP) — Representatives of most of the armed groups in Central African Republic on Monday signed an agreement to honor an immediate cease-fire, after more than three years of sectarian conflict that have left thousands dead.

The announcement in Rome followed negotiations between Central African Republic’s nascent government and 13 of the 14 armed groups currently active in the country where more than 500,000 people are internally displaced.

A Rome-based Catholic organization, the Sant’Egidio Community, mediated the deal.

Negotiators hailed the accord as an important step, although governments in Central African Republic over the past decade have signed scores of deals with various rebel groups only to see them fall apart.

Fighters on the ground don’t always respect terms and issues over disarmament and reintegration into the national military are delicate.

“For us this has been a crucial agreement for the reconciling future of the country, for a future of peace in Central African Republic,” said Charles Armel Doubane, the country’s foreign minister and one of the signatories of the accord.

Only one political-military group couldn’t attend the signing of the agreement but expressed its willingness to actively participate.

Central African Republic was led for a decade by President Francois Bozize, who himself took power in a coup. He was ousted by mostly Muslim rebels in early 2013, ushering in an era of abuses and resentment that led to a militia uprising.

Those fighters – Christian in name, but often animist – exacted revenge on Muslim civilians, forcing most in the capital to flee for their lives. The United Nations has said some of those abuses could be considered crimes against humanity, and the International Criminal Court has opened an investigation.

Violence ebbed somewhat after the landmark visit of Pope Francis in late 2015, and presidential elections were held in relative peace in February 2016. However, over the past year alliances have shifted and fighting has erupted even between formerly allied rebels. The southeast of the country has been particularly wracked by instability.

At the signing ceremony at the Catholic organization’s headquarters, Doubane shook hands with Andrea Riccardi, a founder of the Sant’Egidio Community who has close relations with the Vatican. Sant’Egidio has sought to help resolve many conflicts in Afrida and elsewhere, with its most high-profile success being Mozambique.

Associated Press writer Krista Larson in Dakar, Senegal, contributed to this report.