WASHINGTON—It has become fashionable to refer to Algeria’s war of liberation against the French (1954-1962) when talking about Iraq. President Bush is reading British historian Alistair Horne’s account of that war—“A Savage War of Peace”—and I am reminded that the Pentagon organized a screening of Gillo Pontecorvo’s classic film “The Battle of Algiers” in 2003 in order to study the dangers of confronting Muslim guerrillas.

All Americans would benefit from watching “The Battle of Algiers,” a masterpiece that, despite the fact that the movie was co-produced by a former leader of the National Liberation Front (NLF), is clinical in its depiction of the cruelty that came from all sides, and is devoid of the moralizing and manipulative intentions that often taint political art.

Algeria and Iraq are different beasts, of course. The French had been in Algeria since 1830, so France was a colonial power. There were about a million French citizens in Algeria (the “pieds noirs”), who treated the Arabs and Berbers as second-class citizens. They had powerful representation in Paris.

But there are similarities. There was also a civil war in Algeria between various factions vying for power: the struggle between the NLF and the Algerian National Movement was savage. The NLF targeted fellow Algerians from its inception in 1954 and used indiscriminate terrorism throughout the conflict. Outside influence was considerable: Countries like Tunisia, Morocco and Egypt aided the insurgents.

After the battle of Algiers in 1957—in which the French paratroopers led by Gen. Jacques Massu crushed the terrorist insurgents in the capital using atrocious means—French public opinion turned against its own government. Until then, the right and the left—except for a few intellectual luminaries—had been staunchly behind the effort to keep Algeria in French hands (ironically, the battle of Algiers was fought by a left-wing French government, with none other than Francois Mitterand laying the legal groundwork at the Ministry of the Justice for the use of torture).

What lesson from that conflict is relevant today? The paramount lesson seems this: “First-world” armies and “third-world” guerrillas have different notions of time and space, and therefore of what constitutes defeat and victory. A “first-world” army can defeat “first-world” guerrillas and a “third-world” army can defeat “third-world” guerrillas because in both cases the army and the enemy operate under similar notions of time and space. The Italian security forces were able to defeat the Red Brigades, just as Germany’s security forces were able to defeat the Baader-Meinhof Gang, because they were at war with each other under similar time and space horizons. Equally, Alberto Fujimori’s dictatorship was able to defeat the Shining Path in Peru in the 1990s and Venezuela’s Romulo Betancourt destroyed the Castro-inspired guerrillas in the 1960s because the warring sides shared a common idea of where and when they were fighting. That is not to say that in all such cases the army will triumph. Castro’s victory in 1959 proves that the opposite can happen. But as long as the established power commands enough civilian support, which is usually the case against a terrorist insurgence, the security apparatus enjoys a big advantage.

In Algeria, the occupying force’s notion of space was purely physical and military: The French paratroopers thought that as long as they smoked the terrorists out of the Casbah—the Muslim quarter in Algiers—they would win. The insurgents’ notion of space was historic and civilian: As long as they gave the oppressed masses a sense of the anomaly that the century-old French presence in their land constituted, the liberation struggle would go on. The French army’s notion of time was narrow, while the insurgents had a broad time horizon. The French won the battle of Algiers but in 1962 they had to give up the colony.

It was not a matter of how many troops there were on the ground. In 1960, France had 400,000 troops in Algeria—not far from the number the U.S. poured into Vietnam. And the moral legitimacy of the insurgents is not defined by the methods they employ, but by how close they are to the population and how effectively they help shape the people’s perception of the enemy. Algeria’s insurgents were tyrants, and once they liberated their nation they established a dictatorship. But the fact that they were perceived as legitimate by the civilian population—precisely because their notion of space and time attached them to that population and the country’s history—meant that the occupiers ended up losing the war whose every battle they had won.