IN THE five years since a disputed presidential election triggered a horrific ethnic conflict, Kenya has done much to guard against a recurrence. The constitution was rewritten, with power delegated to newly created states; a new supreme court and electoral commission were created; and an anti-hate-speech law was adopted. The economy has boomed, thickening a rising middle class and giving more Kenyans a stake in preserving the peace.

Much of what caused the violence, however, hasn’t changed — starting with the political leaders who organized and led it. One of the leading presidential candidates, Uhuru Kenyatta, and his vice-presidential running mate, William Ruto, have been indicted by the International Criminal Court (ICC) for their roles in the 2007-08 bloodletting; the other, Raila Odinga, probably should have been. Though a national human rights commission recommended more than 200 people for prosecution, only a handful of trials have taken place. Politics remains driven by ethnicity, and corruption is still rampant.

Kenya’s new elections, scheduled for Monday, consequently have put the country — and its Western allies — on edge. A close vote is expected, with a second round likely in the spring. Though leading candidates have campaigned against violence, there are reports of militias forming and arms being distributed. Peace will depend on a transparently fair vote, a quickly reported result and its acceptance by the political leaders who chose to fight rather than concede five years ago.

There are grounds for optimism. The electoral commission has adopted confidence-building tactics such as reporting results at each polling station and is credited by international observers with having performed relatively well in registering voters. It has promised final results in 48 hours, avoiding the long, inciting delay of 2007. Mr. Kenyatta, the son of Kenya’s first president, and Mr. Ruto are from tribes that battled each other in the Rift Valley in 2008; now they are allied. Yet the two men face the prospect of commuting to the Hague for their trials on crimes against humanity, even if they win the election. Kenya could find itself, like nearby Sudan, headed by an ICC convict and international pariah.

Given that the platforms of Mr. Odinga and Mr. Kenyatta don’t differ much — both favor pro-market economic policies — the tribunal factor gives the outside world reason to hope that Mr. Odinga’s narrow advantage in the polls will translate into a victory. But the most important outcome will be peaceful acceptance of the results by the defeated candidates. The United States, which has considerable leverage — including President Obama’s prestige as the son of a Kenyan — must press the losers hard. The violence of 2007 and its fudged resolution — a coalition government — created a bad model for Africa. This time Kenya should demonstrate that African democracy can work.