Uhuru Kenyatta and William Ruto celebrate their presidential election win. (Reuters/Siegfried Modola.)

Nairobi—During the long gap between Kenya’s presidential election on March 4 and the announcement five days later that Uhuru Kenyatta had won, an American friend of mine who’s lived here for years called to discuss the state of affairs. “If Kenyatta wins he should invite Moreno-Ocampo to his swearing in,” the friend remarked with a laugh.

The reference was to Luis Moreno-Ocampo, until last June the chief prosecutor of the International Criminal Court. Moreno-Ocampo brought charges against Kenyatta and his presidential running mate, William Ruto, stemming from their alleged involvement—ironically on opposite sides—in violence after the 2007 election that left over 1,000 people dead. Both are accused of crimes against humanity that could result in life sentences.

My friend’s comment highlighted the critical role played by the ICC in the 2013 election, in which Kenyatta and Ruto portrayed themselves as victims of arrogant Western powers. Regrettably, Moreno-Ocampo’s actions helped reinforce that notion: not just his active choice to bring the case (the usual practice is for the ICC to act on requests from others) but also his imperial demeanor and clear delight in grabbing the spotlight.

At the time of the election, a majority of Kenyans still supported the ICC process. Anti-Western feeling was growing, however, fanned by claims that Britain and the United States were actively involved in trying to ensure Kenyatta’s defeat. Particularly rankling was State Department official Johnnie Carson’s statement that “choices have consequences.”

But it was the role of the ICC in turning Kenyatta, the son of the country’s first president, into a sacrificial figure among members of his Kikuyu community that was probably the single biggest factor in his success. Many felt that whatever Kenyatta had done after the 2007 election, he had done to protect that community. A Kikuyu friend told me that her neighbors routinely likened Kenyatta to Jesus Christ, and that even in her church a priest had delivered a sermon to that effect.

In the face of such an emotional appeal—which produced huge turnouts in Kenyatta’s strongholds—it would have been hard for any candidate to compete. And to the regret of many who had supported Raila Odinga, his chief opponent, in the 2007 election, Odinga didn’t seem to have the same fire and appeal to the young this time around.

With the country’s economy in weaker shape than in 2007, both Odinga’s and Kenyatta’s party coalitions came up with platforms that were fanciful at best—Uhuru’s promised a solar-powered laptop for every child entering school; Raila’s promised to create a million jobs a year—while the campaigns themselves revolved mainly around personalities and tribal alliances.

In the 2007 election, Odinga was running against incumbent Mwai Kibaki, who was declared the winner under highly suspicious circumstances. Eventually, prodded by the United States, which had initially supported Kibaki’s declaration of victory, Odinga entered into a “grand coalition” that left Kibaki as president but gave Odinga the newly created post of prime minister.

Perhaps because Odinga was hamstrung by the constraints of his new position, he never seemed to find an appropriate role. Finding his decisions routinely countermanded by the president, and dogged by claims he had engaged in nepotism and corruption, Odinga seemed at times a man who’d lost his political touch. Several key allies deserted him, and one adviser whom he kept on long after the man had shown himself to lack good judgment, and whom he then summarily dismissed, subsequently became his loudest detractor. Nor did he shine in the two presidential debates: a poll taken after the first one showed Kenyatta the clear winner.

In a revealing tableau on the day election results were announced, Odinga told a press conference that he was going to file a legal case claiming irregularities in the voting. But standing there looking portly and wearing a tie-clip, the 68-year-old Odinga seemed tired and subdued, in contrast to the youthful 51-year-old Kenyatta and his charismatic 46-year-old running mate. Still, the fact that Odinga made it clear he trusted the courts, and that subsequently the streets remained calm, marked a dramatic change from 2007.

The courts, now reformed and run by a chief justice of unquestioned rectitude, are expected to rule quickly on Odinga’s claims. But given Kenyatta’s 6.2 million votes compared with Odinga’s 5.3 million (another 700,000 were divided among six other candidates), it’s doubtful that they will be found significant enough to require re-tallying or, at the limit, a new election. And even if it’s determined that Kenyatta did not meet the required 50 percent threshold—the official count gave him 50.03 percent—it’s far from clear that a run-off would produce a different result.

Kenyatta has assured the ICC that he will continue to cooperate and appear for his trial, scheduled to begin in July in The Hague. Just how he will do that while running the country remains to be seen. But given the vital importance of Kenya in the “war on terrorism,” it’s a safe bet that the United States will find a way of accommodating to the new realities. And if the ICC emulates the pattern of the US Supreme Court, which has been famously described as following the election returns, it may well do the same.