Government and opposition agree that President Joseph Kabila will step down after elections are held next year.

Joseph Kabila will step down as president of the Democratic Republic of Congo after elections are held before the end of 2017, under an agreement apparently finalised by the government and the opposition.

The deal was concluded on Saturday in the capital Kinshasa, according to negotiators, ending a lengthy stalemate in the country.

“We have reached agreement on all points,” said Marcel Utembi, the bishop who chairs the Episcopal Conference (CENCO) overseeing the talks.

Alexis Thambwe Mwamba, DRC’s justice minister, confirmed that a deal had been reached, saying: “Everything is settled.”

The negotiations, launched on December 8, took place under the aegis of the influential Catholic Church, which had initially set Christmas Day as the deadline for a deal.

The draft deal was made on Friday, but the finalisation of the agreement was delayed due to new demands.

Al Jazeera’s Fahmida Miller, reporting from Kinshasa, said one of the sticking points was the issue of a referendum.

“The government representatives said they wanted to reserve the constitutional right provided by Article 5 to have a referendum before elections are held next year. But they didn’t say what the vote would be about,” she said.

“The opposition said they wanted to remove any loopholes from this agreement. They, of course, opposed the referendum and said the government was trying to keep President Kabila in power.”

Kabila has been holding on to power although his second and final five-year term ended on December 20.

‘Political transition’

The deal envisages a “political transition” with fresh presidential elections to be held at the end of 2017.

The vote was supposed to be organised in late 2016. The government had previously said it was impossible for elections to be held before April 2018.

A transitional government will be put in place by March next year.

The agreement also guarantees that Kabila will not seek a third mandate and lays the groundwork for a “national transition council” charged with carrying out the agreement.

In return, the opposition headed by Etienne Tshisekedi, 84, would accept that Kabila can stay in power until he hands over to an elected successor.

It had previously demanded Kabila’s immediate departure from public life.

In May 2016, Kabila managed to get a court to rule that he could remain in power until a successor was chosen.

The deadline for his departure from office prompted clashes that have left between 56 and 104 people dead.

If Saturday’s deal is followed through, it will be DRC’s first peaceful transfer of power since independence in 1960.

International and African powers feared the failure to secure a peaceful transition of power could lead to a repeat of conflicts seen between 1996 and 2003 in eastern DRC, in which millions died, mostly from starvation and disease.