WE’VE learned from bitter experience about the Law of Unintended Consequences – how government action that’s meant to help people can end up making things worse. That was the case with welfare on demand: It was supposed to help the poor, but wound up contributing to the intergenerational cycle of poverty.

We only hear about the Law of Unintended Consequences when things go bad. But what about good surprises – when the government takes action in one area and the results end up providing a wholly unanticipated but wonderfully welcome benefit elsewhere?

A strong argument can be made that America’s conduct over the past three years in fighting the War on Terror against Islamic extremists has borne surprising fruit in the glorious and thrilling display of liberty in the streets of Kiev.

Millions of Ukrainians are creating an entirely new kind of democratic revolution: They’ve simply refused to let their election be stolen by a government run by a kleptocratic mafia, and they’ve taken to the streets of the capital. As their peaceful, high-spirited, optimistic and profoundly moving protest has grown over the past weeks, it has taken an amazing turn.

This isn’t just a fight against electoral fraud. It’s become the communal expression of the basic human need for self-government.

What we are seeing in Ukraine is the birth of the second stage of the liberation of the former Soviet Union from Communist totalitarianism. The corrupted pseudo-system that arose in Communism’s wake – with strongmen taking more and more power with the support of billionaire “businessmen” who got hold of the reins of the economy in the midst of chaos – is dying before our eyes.

The only hope for Ukraine’s collapsing leadership would have been to massacre the protestors at the start to dissuade others from joining in. But as Natan Sharansky explains in his extraordinary new book, “The Future of Democracy,” an oppressive political system can’t survive forever because it takes too much energy to sustain the oppression.

Ukraine’s thugs couldn’t come down hard on the protest because they no longer had the power to do so. The last gasp of their power came when they stole the election. They couldn’t give the order for a massacre because the order would not have been obeyed. And so an entire political system was delegitimized instantly.

So what does all this have to do with the Law of Unintended Consequences?

For more than three years, the United States has been at war with Islamic extremism. One aspect of it is military – the war against al Qaeda, the Taliban, Saddam Hussein and his remnant. But another aspect is ideological: As never before, America has made the promotion and extension of democracy the centerpiece of its foreign policy.

This relentless push for democracy has been focused exclusively on the Islamic world, to offer a positive counterweight to the seductive ideology of Islamic extremism – a future offering earthly progress rather than earthly misery followed by 72 virgins after death.

But President Bush’s argument on behalf of democracy is universalist. “Liberty is not our gift to ourselves,” he has said, “it is God’s gift to humanity.” No matter where or how they live, human beings are free down to their marrow. The problem is that in too many places, they can’t make full use of their God-given liberty because of oppressive or hostile governments and ideologies.

When the world’s only superpower stakes the future of the world on democracy, it’s going to have ramifications – and we saw one intended ramification in the astonishing conduct of the Afghan people, who went to the polls in mass numbers two months ago.

And now, in Ukraine, we’re seeing this new popular commitment – a commitment by Ukrainians to take charge of their own lives and their own politics.

The blogger Tulip Girl (tulipgirl.com), an American living in Kiev, published a beautiful letter from her Ukrainian friend Lena last week. Ignore the grammatical problems and revel in it:

“Quite recently I didn’t believe that my people able to resist to violence and humiliation. Two months ago I guessed that I live in the worst country in the world. I was oppressed when I could not see a dignity in my fellow citizens, willingness to freedom and happiness. . . . Now I can see that they are not passive mammals who want just to dig [a] comfortable burrow, to generate they own posterity and to finish life in poverty, pretending that there is no another way.

“Since Nov. 22 there are not a crowd on the main square of my country. This is the PEOPLE. This is the NATION. Love, faith and hope filled up a whole space of capital of my country.”

To what extent the Ukrainian revolution has been influenced by American evangelizing about the power of freedom and democracy is something we won’t know for a while. But we can be sure it played some kind of role – and that’s an unintended consequence of which we can all be deeply, deeply proud. And another reason to give thanks for the sacrifice of those who are fighting for freedom in Iraq and Afghanistan.