Incumbent President Uhuru Kenyatta has won Kenya’s rerun vote, the country’s election commission announced Monday, after his opponent boycotted last week’s poll, claiming it was not credible.

While Kenyatta’s victory was not a surprise — he won with more than 95percent of the vote — the tumultuous election season has stretched for months and left East Africa’s most robust economy and a key U.S. ally in a political crisis.

Kenyatta’s win will almost certainly be contested in court, but assuming it is affirmed, he will be running a country plagued by a stark political divide, largely along tribal lines. Aside from the country’s major geopolitical challenges — notably an Islamist insurgency in neighboring Somalia that frequently stages attack on Kenyan soil — Kenyatta will have to find a way to govern many citizens who do not see him as a legitimate president.

Authorities said only about one-third of registered voters cast ballots on Thursday, in stark contrast to the 80 percent that participated in August’s election.

In opposition strongholds, groups have held protests since Thursday’s poll, and the police in some cases have responded with lethal force. At least six people have been killed across the country. The opposition leader, Raila Odinga, has accused the government of “genocidal pogroms.”

A report from Amnesty International on Monday described the security forces’ attempt to intimidate and punish members of the opposition, particularly in the western city of Kisumu, an Odinga stronghold.

“In Kisumu, the evidence we gathered paints a grim picture of police shooting, aggressively assaulting, and even breaking into the homes of people suspected to be protesters,” the report said.

But on Monday afternoon, the country’s electoral commission said it was ready to declare a winner end Kenya’s most chaotic period since 2007, when more than 1,000 people were killed in post-election violence. Western officials have raised concerns that this fraught election might undo some of the democratic progress made over the last decade.

“We are transiting through one of the most difficult and legally uncharted waters,” said Wafula Chebukati, chairman of the Independent Electoral and Boundaries Commission (IEBC).

The rerun election was scheduled after the Supreme Court annulled the original August balloting, in which Kenyatta won 54 percent of the vote to Odinga’s 44 percent. The court said there were voting irregularities and unanswered questions about the electoral commission’s role, casting doubt over the results.

That decision was praised across the world as a proof of Kenya’s judicial independence, but it ushered in a period of immense uncertainty, with the economy slowing dramatically and a crisis of confidence among the country’s election officials.

Earlier this month, Odinga said he was withdrawing from the rerun poll because he believed the electoral commission was still biased against him. He said he was turning his party into a “resistance movement.” Odinga’s critics, and some Western officials, said Odinga might have withdrawn because he had run out of money to finance his campaign.

On Monday, Odinga said he wanted the electoral commission to “carry out a credible election in 90 days.” The only seemingly plausible way that could happen is if the results of the rerun vote are invalidated again by the Supreme Court. While it seems likely that such a case would be brought to court, another annulment would extend Kenya’s period of political paralysis.

One issue likely to be raised in any subsequent court case is that election officials were unable to open 3,635 polling stations out of about 41,000. Those stations remained closed because of opposition protests in western Kenya, which were seen as a threat to election officials.

Chebukati said Monday that conditions in those locations were “not conducive for the commission to conduct the poll.”