Caught unawares by the uprisings, Barack Obama's administration will be pondering how to draw the contours of the post-revolution settlement in Egypt. One immediate impulse will be an effort to load the democratic dice against the Muslim Brotherhood.
In the short term, US influence may be considerable. At this month's Munich Security Conference, the word among diplomats was that Robert Gates, US defence secretary, had been in daily contact with Mohammad Hussain Tantawi, the head of Egypt's military council. The Egyptian armed forces, reliant on US funding and equipment, seem unlikely to rebuff a generous patron.
The US president, however, should resist the temptation of those saying that now that Hosni Mubarak has gone, his country should return to realpolitik as usual. It is not for Washington, or anyone else, to map a path to an "acceptable" outcome.
One of the more obvious lessons of the toppling of Mubarak's regime was that the revolution belongs to Egyptians. The experts who assured Obama that the Egyptian president would weather the storm misread events because they saw the world as it used to be. Deals with generals are yesterday's story. The west now has a bigger audience.
The spread of popular unrest to Bahrain, Libya and Iran carries the same message. There are big differences between each case. While the US and Europe happily cheer those on the streets of Tehran protesting against the ayatollahs, they are less comfortable about the demonstrations in Bahrain. What unites the protests, though, is a demand for human dignity well beyond the control of outsiders.
A good starting point for Obama would be recognition that the US can continue to exercise influence only in so far as it accepts it can no longer impose its will. Some of the choices made in Egypt, Tunisia and elsewhere will be unpalatable to Washington. Tough. Obama should offer the pro-democratic forces help that cannot be mistaken for interference.
This means addressing directly a generation of young Arabs — and Iranians — who want to shape their own destiny. The ancient regime rested on bargains with leaders. In future, Washington's ability to make itself heard will depend on what it says to civil society in the region.
After initial hesitation, Obama has seemed to understand this better than some of America's old foreign policy hands. The US has begun to sound as if it means it when it says it on the side of freedom. European leaders have been slower to respond, though Catherine Ashton, the European Union's foreign policy chief, has rightly emphasised the limits on western influence.
Making the transition from a world of striking deals with leaders to the much more complex business of building relationships with Arab electorates will be a wrenching business.
Advisers will be cautioning Obama against destabilising other friendly regimes in the region. The president's first duty, you can hear them saying, is to restore American "leadership" in the region. This role has rested hitherto on partnership with Israel and strong alliances with the leaders of Egypt and Saudi Arabia.
Israel sees itself as a beacon of liberal democracy in a region. Yet its security strategy has long been built on deals with authoritarian neighbours.
Mubarak's departure has removed an essential pillar of this arrangement. Whatever happens next, it is hard to imagine anything similar being put together again. For Obama, winning respect among the rising generation of Arabs may not be quite as hard as it looks. One of the striking things about the uprisings is the absence of anti-Americanism. The crowds in Tahrir Square could have raged against the US for propping up Mubarak. They chose not to.
The first revolutions have come in those countries that have been most open to US and European cultural influences — and those most adept at channelling western technology to the pursuit of freedom. Sure, there have been Islamists in the crowds, but efforts to draw comparisons with the 1979 Iranian revolution have failed the test of reality.
The issue that cannot be avoided in any new discourse, however, is statehood for Palestinians. It goes without saying that the west will not (and should not) dilute its security guarantees to Israel. But it can take a more even-handed approach to the terms of an eventual settlement.
Unsurprisingly, Netanyahu has responded to events by saying how much harder they will make the search for peace. But he has long shown his disdain for serious negotiations by prioritising the expansion of Israeli colonies in occupied Jerusalem and the West Bank.
This should not prevent the US and Europe from setting out more clearly at the UN the familiar parameters of a two-state solution: borders based on 1967 with agreed adjustments, unequivocal guarantees of Israel's security, a shared capital of occupied Jerusalem and compromise over the Palestinians' right of return.
The dangerous illusion of stability in the Middle East is giving way to the messy beginnings of democracy. Only a fool would say the transition will be easy or without considerable risk. All the more reason for the west to abandon the failed foreign policy of double standards. It might then have the chance to forge a better relationship with the new Middle East than with the old.