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

Kenyatta’s victory was not a surprise — he won with more than 98 percent of the vote. But the tumultuous election season that has dragged on for months has left this country — 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. If it is affirmed, he will confront 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 attacks on Kenyan soil — Kenyatta will have to find a way to govern many citizens who do not see him as a legitimate president.

“Now we can begin the process of reimagining our nationhood,” Kenyatta said in his acceptance speech.