Now, as president of Estonia — then a Soviet republic, now a successful democracy — he watches as another wave of revolution explodes another long-frozen political order in the Middle East. Naturally, he has some lessons from his experience, the first of which might be summed up as: Not everyone makes it to freedom.

“In ’89 to ’91 we thought we saw democracy spreading across an entire region,” Ilves told me in a conversation in his office in Tallinn. “With 20 years’ hindsight, we see that it’s not quite so easy.” Of the East Bloc population served by RFE and Radio Liberty before 1989, just 25 percent now live in countries rated as free, Ilves says. The rest have fallen back under some form of authoritarianism.

Will the Middle East make it to 25 percent in 20 years? That could depend, says Ilves, on whether this generation of revolutionaries makes good decisions about how to build democratic institutions and a free economy — and whether the West is supportive or discouraging. “It turns out that some ways of doing this work much better than others,” he says. “We have to look at what we did right.”

Estonia is a country that got it right, thanks in no small part to the American-educated Ilves, now 57, who helped bring his country into NATO and the European Union before winning election to the mostly ceremonial post of president, where his professorial manner and trademark bow ties are a good fit. Estonia’s political order is generally rated as one of the most free in the world; its economy is one of the most open, and, after a sharp shock during the Great Recession, one of the fastest growing in Europe. The Internet is more pervasive here than in the United States: Voting, government contracting, health care — even dental records — have moved online.

What did this tiny Baltic country do right? First, says Ilves, it created a parliamentary rather than a presidential system; every former communist country with a strong president has become an autocracy. Next, it was aggressive in privatizing its economy, but did so in a way that prevented oligarchs from gaining control over swaths of industry, as in neighboring Russia.

Estonia has a low flat tax and a robust free press, which have headed off the endemic corruption of other new democracies. Finally, Ilves says, it has benefited from an electoral system based on proportional representation — which has preserved minority parties and deterred the winner-takes-all mentality that has polarized countries such as Hungary.

“What we’ve learned,” says Ilves, “is the democracy is not just about building institutions, but building the right institutions.” Which raises the question: Can the lessons from the last wave of anti-authoritarian revolution be shared with this one?

So far, sadly, the answer seems to be no. Ilves talks about assembling the most successful reformers from around Eastern Europe and dispatching them to Cairo and Tunis — but the Arab revolutionaries haven’t shown much interest. Worried about the perception of Western tutelage, they’ve been telling European diplomats to send tourists and investors, but not political specialists.

Egypt is well on its way to making every mistake on Ilves’s list — from perpetuating a strong presidential system, to a majoritarian voting regime for parliament, to an economic policy that may veer away from a free market.

Western governments, meanwhile, seem to be repeating some of the same stumbles they committed during the 1989-91 revolutions. Then, leaders doubted that countries such as Estonia could really win freedom; worried that disruption of the status quo could lead to war or chaos; and clung to diplomatic and personal relationships with a discredited elite.

That history is now repeated in the Middle East, where, says Ilves, “you have an elite that speaks English, that wears suits and ties, who are familiar in Western capitals, but who are completely discredited in their own countries.” Once again U.S. and European leaders are slow to accept that the old status quo is unsustainable, that a new generation of leaders is emerging — that unknown academics and radio station researchers could become presidents and foreign ministers.

Oddly, the current leaders of Eastern Europe are not immune to those errors. Few have fully embraced the Arab Spring; of NATO’s post-communist members, only two — Romania and Bulgaria — have joined the intervention in Libya. A few governments have quietly grumbled about the diversion of European attention and resources to Arab North Africa.

Ilves sees this as short-sighted. “It is our obligation to help,” he says. “We can’t be like some of the large countries of Europe that enjoyed 50 years of U.S. protection and then, when the Cold War ended, didn’t want to extend that security to their East.”

“We’ve seen it all before. So we need to be doing much more.”