Hosni Mubarak had a rendezvous with history last week. So did Barack Obama. For Mr. Mubarak it was an ignominious end to three decades of Pharaonic rule. For Mr. Obama it was the opening of a new page in his presidency in which the promotion of democracy in the Middle East is bound to become a hallmark.
For two years, Mr. Obama has sought to bend the "arc of history" - his words upon Mr. Mubarak's departure on Friday - in favor of Middle East peace without much success. Elsewhere, he has improved America's standing in the world and managed relations with other major powers quite well. But on his big ideas - engaging Iran, resolving the Israeli-Palestinian conflict and rebuilding relations with the Muslim world - he has gained little traction.
Notably absent from his Middle East lexicon in the first year of his presidency was the "D" word - democracy. That had been George W. Bush's folly, begetting a Hamas government in Palestine and the subsequent Israeli-Hamas war in Gaza on the eve of Mr. Obama's inauguration. The new president was determined to avoid democracy promotion in favor of a more gradual approach focused on strengthening civil society.
Egypt's people have now forced a dramatic change in Mr. Obama's approach. This is not immediately obvious in the aftermath of Mr. Mubarak's fall. Fears that the Muslim Brotherhood will take control in democratic Egypt, that instability will sweep the region and that the Israel-Egypt peace treaty will be rent asunder, seem to demand a more traditional focus on stability over freedom.
But once Mr. Obama decided early on in the Egyptian crisis to position the United States on the right side of history, there was no going back. Now with Mr. Mubarak gone, Mr. Obama will need to work to ensure Egypt's democratic transition. This is by no means a sure thing, given that the self-appointed midwife is the Egyptian military. But the generals made an early decision to side with the people. They surely know that the protesters will return to Tahrir Square if they backtrack on their promises to remove emergency laws and ensure free and fair elections.
Partnering with the Egyptian military has considerable advantages for Mr. Obama. They are heavily dependent on U.S. military assistance, they have a big stake in maintaining the Israel-Egypt peace treaty, which they have promptly reaffirmed, and they will keep a wary eye on the Muslim Brotherhood.
Mr. Obama will also need quickly to mobilise funding for the well-oiled American democracy promotion machinery that can help Egypt's youthful secular forces organise for the coming elections. And he would do well to lead an international effort to help revive the Egyptian economy, which was already struggling before the crippling effects of the revolution. Distrustful of Mr. Obama's intentions and deeply ambivalent about democracy, Washington's Gulf Arab allies will be reluctant to help. It would be better for Mr. Obama to encourage western and emerging democracies to take the lead. They are likely to have a more powerful interest in the success of Egypt's democratic transition.
These measures - an enlightened military midwife, well-organised secular parties, support from fellow democracies - will do much to counter the possibility that the Muslim Brotherhood could emerge as the dominant political player. In any case, the Brotherhood seems determined to play a long game, already announcing that it does not want to govern. And in the long term, the best way to counter its bid for control is to ensure that secular forces have enough support.
Given Egypt's centrality to the Arab world, bolstering a sure-footed transition to democracy there will generate powerful popular pressure for democratic change in the rest of the Middle East. Because of that, Mr. Obama needs to encourage our Arab autocratic allies to do what Mr. Mubarak stubbornly refused - open their political space to allow for freedom of expression and more accountable government. He owes it to them to help them get ahead of the demands of their people for political reform, lest they too discover it is too late.
The problem for Mr. Obama in delivering this message is that they will be suspicious of such advice. He will have to make it clear that if they move forwards he will support rather than undercut them.
If he succeeds, it will be marked as one of the Middle East's multiple ironies that the American president who once eschewed democracy promotion in the Arab world ended up helping the people there bend the arc of history toward freedom.