KINSHASA, DRC – Congolese election officials, rejecting independent assessments that a prominent opposition figure was the runaway winner of the December 30 presidential election, on Thursday bestowed victory on a candidate considered more acceptable to the departing President Joseph Kabila.

The decision dashed hopes that the country might experience its first undisputed transfer of power by the ballot box since independence six decades ago. And it was unclear how it would sit with the population.

Still, however malleable the declared winner, Felix Tshisekedi, may seem to Kabila, he was not his first choice. Kabila had backed a top aide to succeed him.

The election commission’s early-morning announcement amounted to a startling admission by the government that Kabila’s candidate had suffered a defeat so big that his government — in power for 18 years — could not simply hand him the presidency without risking widespread violence and international condemnation.

But Tshisekedi had not been seen as the top vote-getter; he was declared the victor on Thursday amid speculation that his campaign had reached some kind of a power-sharing agreement with the Kabila government.

Tshisekedi had trailed another opposition candidate, Martin Fayulu, according to surveys taken shortly before the vote.

Outside observers and institutions also considered the real winner to be Fayulu, given voting data that was compiled by the Roman Catholic Church, one of the few trusted institutions in Congo. The National Episcopal Conference of Congo, a Catholic bishops group, sent 40,000 observers to voting stations across the country.

On Wednesday, as the Congolese awaited an announcement about their next leader, a Washington-based advocacy group that focuses on Africa, the Enough Project, issued a warning. “Civil society, church, and opposition leaders express serious concern that the electoral commission will announce a fraudulent result,” the group said in a statement.

Last week, the bishops group said data from polling booths had showed a clear winner, but it stopped short of identifying him because it did not have the legal authority to do so. Instead, the group demanded that the electoral commission, largely seen by the public as an extension of the government, publish accurate results.

Even though the bishops group did not name a victor, officials who spoke in private with church officials said that the group had identified Fayulu as having won.

In the run-up to the election, a number of surveys suggested that if the elections were free and fair, Fayulu would be the favourite. Opinion polls showed him with 47 percent of support, ahead of 24 percent for Tshisekedi and 19 percent for Emmanuel Ramazani Shadary, President Kabila’s handpicked successor.

According to the electoral commission’s provisional results, Tshisekedi polled 7,051,013 votes or 38,57 percent. Fayulu came second with 6,366,732 votes and Shadary third with 4,357,359 votes. The turnout was 47.56 percent.

Riot police were positioned around Kinshasa, the capital, including near the election commission. Because of the threat of violence, the United States Embassy urged Americans to leave the country.

Electoral observers from South Africa said that the vote had gone “relatively well,” given the relatively low level of election-related violence across a country almost as big as western Europe.

But a Congo-based observer mission, Symocel, said that there had been “major” irregularities, including people tampering with results or counting centers that did not post vote tally sheets in view of the public, as required by law.

On Wednesday, before the result was announced, the presidents of South Africa and Zambia, Cyril Ramaphosa and Edgar Lungu, issued a joint statement calling on Congo’s electoral commission to “speedily” complete the vote counting and declare a winner. The delay, the statement read, “can lead to suspicions and compromise peace and stability of the country.”

The United Nations Security Council is to meet on Friday to discuss the election.

The vote was marred from the beginning. The election was delayed by two years as President Kabila tried to change the Constitution to allow him to stay in office beyond the two-term limit. He broke a promise to hold elections in 2017.

As he clung to power, security forces sprayed protesters with bullets and detained hundreds as the government attempted to quash any resistance. Shadary, the former interior minister who was backed by Kabila in the election, was recently placed on a European Union sanctions list for brutally suppressing protesters in 2017.

Last year, Kabila stunned the country by agreeing to not run in the 2018 elections. He then announced his chosen successor, Shadary, on the last day for candidates to register.

Still, in a recent interview, Kabila would not rule out returning to power in the future.

The electoral process was further muddied after the government refused to allow major Western electoral observers and international donor funds to take part.

In what struck some as the coup de grâce, in the week before the election, a mysterious fire destroyed election materials in a depot in Kinshasa. The electoral commission used the fire as reason to postpone the vote for a week. In the same week, it also said violence and an Ebola outbreak in the east and the southwest were grounds to exclude voters there. They make up some four percent of the electorate.

In the 10 days since the vote, speculation has been rife about back-room negotiations to transfer power to Tshisekedi. He is the son of a charismatic leader Étienne Tshisekedi, a one-time Prime Minister who died two years ago and whose name still resonates widely across the country.

“The regime could envisage a deal with Tshisekedi for several reasons,” said Adeline Van Houtte, an analyst at the Economist Intelligence Unit.

The opposition coalition of Tshisekedi, Cap pour le Changement, is in a weak position, Van Houtte said. On its own, she said, it would not have won the election. And Fayulu’s campaign, she said, seemed “to have numbers backing its victory and the key — unofficial though — support of the Catholic Church and the international community.”

For Kabila, Van Houtte said, a Tshisekedi presidency “would be easier to manage than a Fayulu presidency,” which would be “worst case scenario” for his ruling coalition.

Fayulu “has no intention of protecting Kabila’s regime,” Van Houtte said, adding that he has been leading anti-government protests and is considered an “extremist” by the regime.

Fayulu had said he would not seek revenge on Kabila officials if he won. But, Van Houtte said, he was expected “to crack down on the pervasive networks of corruption that is at play in the country, something Kabila, his entourage and the country’s elite are probably fearful of.”

Kabila has ruled since the 2001 assassination of his father, Laurent Kabila, who overthrew long-serving dictator Mobutu Sese Seko in 1997.

Whoever takes power via the ballot box would be the first to do so since Prime Minister Patrice Lumumba was toppled in a coup less than three months after the DRC won its independence from Belgium in 1960. Lumumba was killed four months later.

The DRC suffers from widespread corruption, continuing conflict, endemic disease, and some of the world’s highest levels of sexual violence and malnutrition. It is also rich in minerals, including those crucial to the world’s smartphones and electric cars.