Imagine an Egypt that consistently opposes the West in international forums while relentlessly campaigning against Israel. A government that seeds its media with vile anti-Semitism, locks relations with Israel in a cold freeze and makes a habit of publicly rejecting "interference" in its affairs by the United States. A regime that allows Hamas to import tons of munitions and Iranian rockets into the Gaza Strip.
That would be the government of Hosni Mubarak - the same one that the United States propped up with tens of billions of dollars in aid, at the cost of tarnishing America's image among democrats and a frustrated young generation across the Middle East. If Egypt now makes a transition to genuine democracy, its foreign policy might not get much better from Washington's point of view. But it is unlikely to get worse.
In fact, the gloomy speculation about a possible Islamic takeover or the loss of U.S. influence ignores the more likely upsides of Egypt's revolution. As in Asia and Latin America after their democratic transitions, the United States will gain more than it loses from the spread of freedom in the Middle East. In the end, the benefits could be huge.
The first will be the exposure of a 30-year-fraud perpetrated by Mubarak's regime. That was the notion that unconditional U.S. military aid and tolerance of autocracy was the inescapable price for Egypt's perpetuation of a peace treaty with Israel, its "help" with Hamas and its "support" for the Middle East peace process.
The reality is that Mubarak maintained his distinctly cold peace with Israel - which he visited once in 29 years - because it was in Egypt's vital interest. The country has no territorial claim and no motive to go to war with its neighbor, and its military is less able than ever to challenge Israel's 21st-century army. A democratic government might be unfriendly to the Jewish state, but it will not abrogate the peace treaty. If it allows Hamas to smuggle in Iranian weapons or opens the border to the Gaza Strip, it will differ by degree - if at all - from Mubarak.
As for the peace process, a new government will inherit mostly broken promises by Mubarak to Washington. In recent years Egypt solemnly swore to prevent a Hamas takeover of Gaza, stop the smuggling of arms through tunnels, arrange a reconciliation between Hamas and the Palestinian Authority, and broker a deal to free an Israeli soldier held by Hamas. It delivered on none of this.
So the first benefit of a democratic Egypt will be a government that will have to take responsibility for its policies, instead of tacitly blaming them on the United States - and extracting unnecessary bribes from Washington. It will have to defend its policies to its own people - which means, for example, that it will have an incentive to check rather than promote anti-Semitic propaganda.
A second benefit should be the end of an era in which U.S. administrations were blamed by Arab media and much of the public for torture, censorship and other repression. That connection not only has fueled anti-Americanism in the region but has also motivated terrorists such as Ayman al-Zawahiri, the Egyptian who is al-Qaeda's second in command.
The United States used to be tarred with the crimes of dictatorships in Brazil, Indonesia, South Korea and Turkey, too. Now all of those countries, as democracies, mostly respect human rights - and still have friendly relations with the United States. Few blame Washington for their policies. Sometimes they are difficult to work with, and sometimes they vote the wrong way in the U.N. Security Council. But they share U.S. values - and they are enemies of terrorism. A democratic Egypt is more likely to follow their course than that of undemocratic Iran or Venezuela.
That brings us to the biggest losers in Egypt's transformation - Iranian Supreme Leader Ayatollah Ali Khamenei and Tehran's clients in Syria and Lebanon. Egypt's transformation will spell the final doom of the Arab governing model of autocratic nationalism, some 60 years after it was created in Cairo. How long can Syria's Bashar al-Assad, whose regime was built on the model of Gamal Abdel Nasser, survive in a world of Arab democracy? And how will Iranians, whose popular revolution in 2009 fell short, react to the triumph of people power in Cairo?
Some in Washington worry that Egypt will follow the course of revolutionary Iran. There is some chance of that; sometimes revolutions are hijacked. Regression to authoritarianism is possible, too: witness Ukraine seven years after its Orange Revolution. But the history of the Middle East, and the world, suggests that the tide will run the other way. A democratic Egypt will sooner or later transform its region - and the United States will be a beneficiary.