THE RESULTS of Egypt’s presidential election will be bitter for most of those who organized and led last year’s revolution against the autocracy of Hosni Mubarak. Placing first and second in the two-day vote, according to unofficial results, and headed for a runoff next month were Mohammed Morsi of the Islamist Muslim Brotherhood and Ahmed Shafiq, a former Air Force general and Mubarak loyalist who represents what Egyptians call the “remnants” of the old regime. The votes of secular liberals were scattered among several candidates, none of whom were both secular and liberal; the most successful, leftist Hamdeen Sabahi, appeared to place third.

If confirmed, the choice between Mr. Morsi and Mr. Shafiq will not be a happy one. A victory by either one would pose the risk of accentuating the conflict and chaos that has plagued Egypt in the last 15 months. But the unfortunate result should not lessen the significance of what occurred last week: the freest and fairest vote for president in Egyptian history. Though three leading presidential candidates were disqualified, a dozen others openly campaigned for the job; despite complaints by the losers no evidence of significant fraud has surfaced. In what has been a seesaw battle over the future of the most populous Arab nation, the election represents another step toward democracy.

The results showed that Egypt is hardly polarized between Islamists and the former military-backed regime. According to the preliminary results Mr. Morsi and Mr. Shafiq received, together, less than half the vote; Mr. Morsi’s total of about 25 percent was far below the more than 40 percent won by the Muslim Brotherhood in parliamentary elections just five months ago. Secular candidates received considerably more than half the vote. Mr. Sabahi, who espouses the Arab nationalism of former Egyptian president Gamal Abdel Nasser, was reported to have placed first in Cairo.

A victory by Mr. Morsi in the second round would give Islamists control of both the presidency and parliament. The Brotherhood has vowed to respect democratic norms and women’s rights, to pursue free-market economic policies, and to maintain peace with Israel. But Mr. Morsi, 60, is a conservative who has vowed to steer the country toward Islamic law. Mr. Shafiq is even more worrisome: He could seek to restore the former autocracy, backed by the military and its intelligence services. Egyptians are already talking about the possibility that the second round could provoke more turmoil in the streets or a military coup.

In fact the country’s best chance lies in staging another fair vote in the second round and allowing the winner to take office — a course the Obama administration should be urging on the ruling military council. The powers of the Egyptian president have yet to be defined by a new constitution; checks and balances are essential to ensure that the winner cannot accumulate excessive power. If that is done, an elected Egyptian president, even a bad one, could lead his country, and the region, into a new era — one in which democracy is on the rise.