WITH LIBYA, Yemen, Bahrain and Syria now all embroiled in rebellions, it is not an exaggeration to suggest that the authoritarian lid that has smothered freedom in the Arab world for centuries may be coming off all 350 million Arab peoples at once. Personally, I think that is exactly what is going to happen over time. Warm up the bus for all the Arab autocrats — and for you, too, Ahmadinejad. As one who has long believed in the democracy potential for this part of the world, color me both really hopeful and really worried about the prospects.

I am hopeful because the Arab peoples are struggling for more representative and honest government, which is what they will need to overcome their huge deficits in education, freedom and women’s empowerment that have been holding them back. But getting from here to there requires crossing a minefield of tribal, sectarian and governance issues.

The best way to understand the potential and pitfalls of this transition is to think about Iraq. I know that the Iraq war and the democracy-building effort that followed have been so bitterly divisive in America that no one wants to talk about Iraq. Well, today we’re going to talk about Iraq because that experience offers some hugely important lessons for how to manage the transition to democratic governance of a multisectarian Arab state when the iron lid is removed.

Democracy requires three things: citizens — that is, people who see themselves as part of an undifferentiated national community where anyone can be ruler or ruled. It requires self-determination — that is, voting. And it requires what Michael Mandelbaum, author of “Democracy’s Good Name,” calls “liberty.”

“While voting determines who governs,” he explained, “liberty determines what governments can and cannot do. Liberty encompasses all the rules and limits that govern politics, justice, economics and religion.”

And building liberty is really hard. It will be hard enough in Middle East states with big, homogenous majorities, like Egypt, Tunisia and Iran, where there is already a powerful sense of citizenship and where national unity is more or less assumed.

It will be doubly hard in all the other states, which are divided by tribal, ethnic and sectarian identities and where the threat of civil war is ever present.

Not one was more divided in that way than Iraq. What did we learn there? First, we learned that when you removed the authoritarian lid the tensions between Iraqi Kurds, Shiites and Sunnis erupted as each faction tested the other’s power in a low-grade civil war. But we also learned that alongside that war many Iraqis expressed an equally powerful yearning to live together as citizens. For all of the murderous efforts by al-Qaida to trigger a full-scale civil war in Iraq, it never happened. And in Iraq’s last election, the candidate who won the most seats, a Shiite, Ayad Allawi, ran on a multisectarian platform with Sunnis. Lesson: While these tribal identities are deeply embedded and can blow up at anytime, there are also powerful countertrends in today’s more urbanized, connected, Facebooked Middle East.

“There is a problem of citizenship in the Arab world,” said Michael Young, the Lebanese author of “The Ghosts of Martyr’s Square,” “but that is partly because these regimes never allowed their people to be citizens. But despite that, you can see how much the demonstrators in Syria have been trying to stay nonviolent and speak about freedom for the whole nation.”

Lesson 2: What was crucial in keeping the low-grade civil war in Iraq from exploding, what was crucial in their writing of their own constitution for how to live together, and what was crucial in helping Iraqis manage multiple fair elections was that they had a credible neutral arbiter throughout this transition: the U.S.

America played that role at a staggering cost, and not always perfectly, but played it we did. In Egypt, the Egyptian army is playing that arbiter role. Somebody has to play it in all these countries in revolt, so they can successfully lay the foundations of both democracy and liberty. Who will play that role in Libya? In Syria? In Yemen?

The final thing Iraq teaches us is that while external arbiters may be necessary, they are not sufficient. We’re leaving Iraq at the end of the year. Only Iraqis can sustain their democracy after we depart. The same will be true for all the other Arab peoples hoping to make this transition to self-rule. They need to grow their own arbiters — their own Arab Nelson Mandelas. That is, Shiite, Sunni and tribal leaders who stand up and say to each other what Mandela’s character said about South African whites in the movie “Invictus”: “We have to surprise them with restraint and generosity.”

This is what the new leaders of these Arab rebellions will have to do — surprise themselves and each other with a sustained will for unity, mutual respect and democracy. The more Arab Mandelas who emerge, the more they will be able to manage their own transitions, without army generals or outsiders. Will they emerge? Let’s watch and hope. We have no other choice. The lids are coming off.

Thomas Friedman is a syndicated columnist who writes for the New York Times.

(Click here if you are unable to view this photo gallery on your mobile device) The Ruth Bancroft Garden in Walnut Creek celebrates the life of its founder Ruth Bancroft who died at 109 on November 26, 2017. The Ruth Bancroft Garden is a nonprofit public dry garden that was planted by Mrs. Ruth Bancroft in 1972 and was opened to the...