The Central African Republic struck a peace deal with 14 armed groups after direct talks to end years of conflict, the UN said on Saturday. Thousands of people have been killed and hundreds of thousands displaced since 2013 in a conflict that has sent two people to the International Criminal Court. The parties were due to sign a draft deal on sharing power and transitional justice, said Sudan’s chief negotiator, Atta Al Manan. The final deal is expected to be signed on Wednesday. “This is a great day for Central African Republic and all its people,” said the African Union’s commissioner for peace and security, Smail Chergui. Fighting began in 2013 when predominantly Muslim Seleka rebels seized power in the capital, Bangui. Mainly Christian anti-Balaka militias fought back. Scores of mosques were burnt, priests and other religious leaders were killed and many Muslims fled the country after mobs decapitated and dismembered people in the streets. The fighting was so alarming that Pope Francis made a bold visit in 2015, removing his shoes and bowing his head at the Central Mosque in the last remaining Muslim neighbourhood in the capital. “Together we say no to hatred,” the pontiff said. The violence never disappeared, intensifying and spreading last year after a period of relative peace as militia fought over lands rich in gold, diamonds and uranium. After more than 40 people were killed in a rebel attack on a refugee camp in November, the leader of the 13,000-strong UN peacekeeping mission and the country’s prime minister admitted their response was not enough. “I knew that we did not have all the necessary means to protect our people,” Prime Minister Simplice Sarandji said. In a report last year marking five years of the conflict, the UN children’s agency said fighters often attacked civilians, hitting hospitals, schools, mosques, churches and camps for the displaced. At least half of the more than 640,000 people displaced are children, it said, and thousands were thought to have joined the armed groups, often under pressure. Last month the chief of the Central African Republic’s football federation appeared at the ICC on charges of crimes against humanity and war crimes. Patrice-Edouard Ngaissona is accused of leading the anti-Balaka militia for at least a year early in the fighting. In November, a Central African Republic militia leader and politician, Alfred Yekatom, made his first ICC appearance accused of crimes including murder, torture and using child soldiers. He was said to have commanded about 3,000 fighters in a predominantly Christian militia in and around Bangui. So far no Seleka fighters have been publicly targeted by the court. As the peace talks began last month, the Norwegian Refugee Council warned of "catastrophe" if no agreement was reached, saying repeated cycles of violence in one of the world's poorest nations had "pushed people's resistance to breaking point". A majority of the country's 2.9 million people urgently need humanitarian support, the group said. On Thursday, the UN Security Council voted unanimously to extend an arms embargo on the Central African Republic for a year but also said this could be lifted earlier.