The results are now in. On the eve of July 4, secular Egyptian protesters have achieved something like their own Declaration of Independence against the threat of Islamist takeover. With a desperate Morsi rocked by protests even larger than those that toppled Mubarak--one state-run outlet is reporting that the Egyptian military has already ousted him from office--some lessons are already apparent. Once again, an Islamist political party in charge has failed the simple test of finding its way into the modern world. Ideology trumped reality in an era when the reality of the global economy demands fast integration, openness, and adherence to basic economic principles. So we have already seen in Iran since the Islamist revolution of 1979, with Hamas in Gaza and Hezbollah in Lebanon, and even to a degree in Turkey where Prime Minister Recep Tayyip Erdogan's more mildly Islamist party has found itself confronted with angry and violent street protests (despite the very different political history that brought Erdogan to power).

But the lesson of Egypt, which for centuries has been considered the cultural and historical center of the Arab world, is perhaps the starkest of all.

Over the past year Morsi, the first elected Islamist head of state in Arab history, has been the subject of an unprecedented set of experiments. To wit: Could radical jihadists in power adapt and learn to govern pragmatically, especially by linking up Egypt's impoverished economy to the global system? Could an Islamist head of state renounce jihadist violence in practice instead of theory, in contrast to al-Qaida or its many offshoots, as well as Hamas and Hezbollah? Could Morsi work with the international community rather than consistently defy it, as the Iranian regime had done?

Morsi failed miserably on several of those counts, particularly and perhaps fatally the first. Egypt's economy remains a disaster, with rising food prices, long gas lines and daily blackouts. To her credit, U.S. Ambassador Anne Patterson warned Morsi of the dangers in a blunt speech in Alexandria this February, when she noted that the government owed billions to oil companies, was running out of foreign reserves, and that Morsi was failing to supply his people with the most basic needs.

The future of Egypt's infant democracy is now utterly unclear, but there is some cause for hope. While the most radical Islamists will no doubt draw the wrong lessons from the turmoil in Egypt--don't participate in Western-style democratic elections at all--the smarter and more numerous Islamist parties will, like many in the already-fractious Muslim Brotherhood (which has seen many defectors), have no choice but to learn to compromise on their ultimate dreams of a fundamentalist state far more than they have already done. Already the radical Salafist Nour Party has hedged, cautiously siding with the protesters and calling for fast presidential elections in order to avoid "civil war."