THE Democratic Republic of Congo has never had a peaceful transition of power. Mobutu Sese Seko, the president from 1965 to 1997, fled his jungle palace shortly before it was ransacked by looting soldiers; his successor, Laurent Kabila, was shot by one of his bodyguards. So the country has been on edge as an election, scheduled for December 23rd, draws closer. It is already grappling with an outbreak of Ebola and armed conflicts in ten of its provinces.

The big question was whether Joseph Kabila, the unpopular president (pictured), would run again. Mr Kabila inherited the job from his father, Laurent, in 2001. He is accused of corruption, incompetence and human-rights abuses. The constitution required him to step down when his second term ended in 2016, but he stayed on, citing a clause that allowed him to remain president until a new one was elected. He then repeatedly delayed elections and cracked down hard on those who protested.

As other candidates registered their names ahead of the August 8th deadline, Mr Kabila waited until the last moment to announce that he would not run again. Instead the coalition that includes his party, the People’s Party for Reconstruction and Democracy (PPRD), will put forward Emmanuel Ramazani Shadary, who is the PPRD’s permanent secretary. Many see the 57-year-old former interior minister as a potential puppet of Mr Kabila.

Mr Shadary’s strongest rival is likely to be Jean-Pierre Bemba, a former vice-president and, before that, a rebel leader. Mr Bemba’s conviction for war crimes was overturned on June 8th after he had served ten years in prison in The Hague. He had previously been held responsible for an epidemic of murder, rape and pillage committed by fighters under his command. Tens of thousands of people lined the street from the airport to celebrate Mr Bemba’s return to Congo on August 1st.

Mr Kabila was less enthused. Fearing unrest, the police blocked the road to Mr Bemba’s house in Kinshasa, which is close to the president’s residence. Then they dispersed Mr Bemba’s supporters using tear gas and rubber bullets. One man was killed when a police car ran over his head.

Mr Bemba narrowly lost to Mr Kabila in an election in 2006. His supporters celebrate the fact that his parents are Congolese, while claiming that Mr Kabila’s mother was Rwandan, which he denies. “Congolais, 100%”, they say. Even while in prison he met with opposition leaders and stayed abreast of Mr Kabila’s actions. “He never lost his self-assurance,” says one visitor. “He used to treat his jailers as if they were his personal bodyguards.” Some liken Mr Bemba, absurdly, to Nelson Mandela: released from prison to save his flailing country from misrule. His opponents want to bar him from running based on a second conviction, which was not overturned, of witness tampering.

As Mr Bemba was registering with the electoral commission (a privilege that costs $100,000), another potential candidate was being barred from entering Congo. In 2016 Moïse Katumbi, a former governor of mineral-rich Katanga province, was sentenced in absentia to three years in prison for property fraud. He had gone to Belgium shortly after falling out with Mr Kabila, whom he accused of twisting the constitution to stay in power. The president’s powerful former ally, who would have been Mr Shadary’s biggest rival, was told he would be arrested if he tried to come home. Still, he tried twice, unsuccessfully.

The electoral commission is now reviewing the list of presidential candidates, which will be announced on September 19th. Until then Congo holds its breath. If Mr Bemba’s candidacy in annulled, making way for Mr Shadary, the country might be in for even more bloodshed.