The government and opposition parties in the Democratic Republic of the Congo have reached a deal that calls for President Joseph Kabila to leave power after the next election. In a concession to the opposition, that vote now will take place before the end of 2017.

Kabila, 45, was due to give up power after the end of his second term as president earlier this month.

The end of his mandate on 19 December prompted protests in cities across the DRC. More than 40 people are thought to have died and hundreds were arrested during two days of violence.

The clashes came during a pause in negotiations between representatives of the fragmented opposition and the government that have been held under the auspices of the Catholic church.

Negotiators have spent weeks in tense talks seeking to ensure the first peaceful transfer of power since the vast resource-rich central African state gained independence from Belgium in 1960.

It remains very unclear, however, if leading politicians, including Kabila, will keep to the terms. Kabila will be unable to change the constitution to allow him to stay in power for a third term.

This is a crucial concession; Kabila’s aides have long argued that the president has a responsibility to remain in office until free and fair elections can be safely held.

Joseph Kabila supporters parade the president’s image through Kinshasa. Photograph: Lionel Healing/AFP/Getty Images

Given that the logistic and financial obstacles to holding polls that come close to international standards in the DRC are immense, opponents and many observers fear this is a pretext to remain in power indefinitely.

According to the deal, Kabila will appoint a prime minister from the country’s main opposition bloc to oversee the transition, a major sticking point in the final stages of the talks.

Neither Kabila nor the country’s leading opposition leader, 84-year-old Etienne Tshisekedi, were expected to sign the deal, raising concerns about whether it would be respected.

Spokesmen for the government and Kabila’s ruling coalition were not available for immediate comment.

The talks are being keenly watched in western capitals. The deal is seen as likely to boost pro-democracy activists in other African countries and help counter a trend in recent years of presidents changing constitutions to stand for third terms.

International aid is also likely to be essential for any polls. Western and African powers fear the current impasse could lead to a repeat of the conflicts seen between 1996 and 2003 in which as many as 5 million people may have died, mostly from starvation and disease.

The conflict was the deadliest in modern African history, involving two rounds of fighting in the late 1990s and early 2000s which dragged in at least six countries’ armies.

The DRC’s restive east remains a battleground for rival ethnic militias, with a recent upsurge of violence there a concern to many experts.

Kabila, a former guerilla commander, came to power in 2001 following his father Laurent’s assassination. He won elections in 2006 and was initially welcomed by the west. A second election win in 2011 was marred by allegations of major fraud.

Analysts suggest three possible outcomes to the current crisis. If the instability proves “transitional”, it may lead to a process that brings any new government domestic and international legitimacy. Failing that, a bloody, popular urban uprising could oust the president or the government could collapse slowly as economic weakness, meddling by regional powers and international isolation undermine its authority.