The problem with democracies is that they can be very messy and unpredictable, particularly new ones transitioning from dictatorial rule.
Former Egyptian President Hosni Mubarak may have maintained power by using his security forces and torture to gain information, then locking opponents in his prisons, but, hey, at least he was a reliable U.S. ally and a rare friend to Israel in the Middle East neighborhood.
The United States has embraced many a loathsome leader out of such diplomatic expediency.
When the Arab spring spread to Cairo and Egyptians across political, religious and social spectrums took to the streets to demand an end to Mubarak's rule, it held out hope that governance could emerge in Egypt that was both diplomatically reliable and domestically pluralistic. The Obama administration rightly embraced the change.
But in their first presidential vote since Mr. Mubarak's ouster, Egyptian voters opted not for candidates who represented a middle path, but for extremes, raising concerns both about that nation's internal future and its international conduct.
The top two vote getters, who will now face off in a mid-June election, were Mohamed Morsi of the Muslim Brotherhood and Ahmed Shafik, a former air force general and Mubarak's final hand-picked prime minister. This offers a stark and not terribly attractive choice for Egyptians. They can elect Mr. Morsi and strengthen the hands of the Brotherhood, already in control of Parliament, inviting creation of a theocracy under Islamic law. Or they can choose the law-and-order Mr. Shafik, who has made it clear he will use an iron hand to restore order and, we suspect, quash opposition and neutralize the Parliament.
Giving full power to the Muslim Brotherhood appears the greatest danger. Its leaders, including Mr. Morsi, have said the right things about protecting Egypt's Christian minority and respecting the peace treaty with Israel. But Mr. Morsi's platform, focused on purifying Egyptian society to comply with Islamic law, has to worry Christians, liberals and secularists. And the Brotherhood's kinship with Hamas certainly gives Israeli's leaders pause.
The military, the most dominant institution in Egypt, remains the wildcard. It could invoke its power if a Brotherhood-led government pushes too far or to enable abuses by a Shafik government.
At least a divided Egyptian government might provide a check and balance that could temper extremist tendencies as this ancient nation struggles to establish democratic ideals.
However it plays out, the Obama administration, having helped Mr. Mubarak out the door, needs to remain diplomatically engaged, with the threat of cutting U.S. assistance its greatest lever.