Revolutions usually start with enthusiasm and end in tears. In the case of the Middle East, the tears could be avoided if President Obama stands firmly by the values that got him elected. Although American power and influence in the world have declined, our allies and their armies look to us for direction. These armies are strong enough to maintain law and order as long as they stay out of politics; thus the revolutions can remain peaceful. That is what the United States should insist on while encouraging corrupt and repressive rulers who are no longer tolerated by their people to step aside and allow new leaders to be elected in free and fair elections.

That is the course that the revolution in Tunisia is taking. Tunisia has a relatively well-developed middle class, women there enjoy greater rights and opportunities than in most Muslim countries, and the failed regime was secular in character. The prospects for democratic change are favorable.

Egypt is more complex and, ultimately, more influential, which is why it is so important to get it right. The protesters are very diverse, including highly educated and common people, young and old, well-to-do and desperately poor. While the slogans and crowds in Tahrir Square are not advancing a theocratic agenda at all, the best-organized political opposition that managed to survive in that country's repressive environment is the Muslim Brotherhood. In free elections, the Brotherhood is bound to emerge as a major political force, though it is far from assured of a majority.

Some have articulated fears of adverse consequences of free elections, suggesting that the Egyptian military may seek to falsify the results; that Israel may be adamantly opposed to a regime change; that the domino effect of extremist politics spreading to other countries must be avoided; and that the supply of oil from the region could be disrupted. These notions constitute the old conventional wisdom about the Middle East - and need to be changed, lest Washington incorrectly put up resistance to or hesitate in supporting transition in Egypt.

That would be regrettable. President Obama personally and the United States as a country have much to gain by moving out in front and siding with the public demand for dignity and democracy. This would help rebuild America's leadership and remove a lingering structural weakness in our alliances that comes from being associated with unpopular and repressive regimes. Most important, doing so would open the way to peaceful progress in the region. The Muslim Brotherhood's cooperation with Mohamed ElBaradei, the Nobel laureate who is seeking to run for president, is a hopeful sign that it intends to play a constructive role in a democratic political system. As regards contagion, it is more likely to endanger the enemies of the United States - Syria and Iran - than our allies, provided that they are willing to move out ahead of the avalanche.

The main stumbling block is Israel. In reality, Israel has as much to gain from the spread of democracy in the Middle East as the United States has. But Israel is unlikely to recognize its own best interests because the change is too sudden and carries too many risks. And some U.S. supporters of Israel are more rigid and ideological than Israelis themselves. Fortunately, Obama is not beholden to the religious right, which has carried on a veritable vendetta against him. The American Israel Public Affairs Committee is no longer monolithic or the sole representative of the Jewish community. The main danger is that the Obama administration will not adjust its policies quickly enough to the suddenly changed reality.

I am, as a general rule, wary of revolutions. But in the case of Egypt, I see a good chance of success. As a committed advocate of democracy and open society, I cannot help but share in the enthusiasm that is sweeping across the Middle East. I hope President Obama will expeditiously support the people of Egypt. My foundations are prepared to contribute what they can. In practice, that means establishing resource centers for supporting the rule of law, constitutional reform, fighting corruption and strengthening democratic institutions in those countries that request help in establishing them, while staying out of those countries where such efforts are not welcome.

The writer is chairman of the Soros Fund Management and the Open Society Foundations, which support democracy and human rights in more than 70 countries.