Democratic Republic of Congo's President Joseph Kabila arrives for a southern and central African leaders' meeting to discuss the political crisis in the Democratic Republic of Congo in Luanda, Angola, October 26, 2016. REUTERS/Kenny Katombe

KINSHASA (Reuters) - Congo’s opposition leaders signed a deal with the party of President Joseph Kabila on Saturday that will require him to step down after elections that must take place before the end of 2017.

Mediators from the Congo’s Catholic church had been heaping pressure on both sides for weeks to sign an agreement aimed at averting a slide into anarchy and possibly another civil war over Kabila’s decision not to step down despite his mandate expiring more than a week ago.

If they stick to it, the agreement will deliver Democratic Republic of Congo’s first peaceful transfer of power since independence from Belgium in 1960.

“Today, we are happy to head up a political compromise,” said Marcel Utembi, President of the Catholic Bishops Conference, before representatives of Kabila’s party, including Mines Minister Martin Kabwelulu and Interior Minister Emmanuel Shadary, and its main opposition alliance, signed the deal.

Huge hurdles remain, however. The electoral commission has said elections may not be possible before 2018, and many doubt Kabila really intends to stand down. Several of his supporters have floated the idea of changing the constitution to enable him to run for another term, as other African leaders have done.

Any failure to implement the deal would worsen instability that has seen scores of people killed over the past four months, many of them protesters shot dead by security forces. Police and military killed around 40 people last week protesting when Kabila’s mandate ran out on Dec. 20.

“Now that all pretexts for various plots against the republic have been removed, I call everyone to ... to create conditions of true peace and stability throughout the country,” Kabila said in a year-end address to the nation, which however did not directly address his own view on the talks.

Diplomats fear growing unrest could trigger a repeat of the wars between 1996 and 2003 that killed millions, unleashed dozens of predatory armed groups and drew in more than half a dozen neighboring armies.