Revolutionary regimes, in the grip of a universalist faith, are often prepared to use violence to export their ideology. France did so after 1789, Russia after 1917 and Cuba after 1959. Only one revolutionary state currently poses a serious threat to world order: Iran. Like 18th-century France and 20th-century Russia, Iran has fused the expansionary impulse of an imperial power with an ideological attack on the status quo. But that only makes Iran harder to deal with, above all for the United States, the chief pillar of that status quo.

''The Twilight War'' explains the baffled and sometimes hapless and often contradictory response of American policy makers to the Iranian revolution over the last 33 years. We all know the basic outlines of the story: the hostage crisis under Jimmy Carter, the bungled arms-for-hostages deal under Ronald Reagan, George W. Bush's ''axis of evil,'' Barack Obama's ''engagement'' policy followed by a tightening vise of sanctions. David Crist, a historian for the federal government and a Marine veteran, has tied all these clanking tin cans together. As adversaries go, Iran has proved to be much more bewildering, if until now far less dangerous, than the Soviet Union, its predecessor as America's Public Enemy No. 1.

Republicans nostalgic for Reagan's assertiveness will find this account extremely painful. The decade-long war between Iran and Iraq flummoxed Reagan and his team, who tried to fit all events into a familiar cold war framework. Believing at first that it could weaken Baghdad's ties with Moscow, the administration carried on an elaborate clandestine relationship with Iraq's military and intelligence apparatus. Senior State Department officials found donor countries to supply Saddam Hussein with weapons, while American military planners in Baghdad provided grid coordinates of Iranian targets to Iraqi pilots.

In the midst of the war, however, Reagan's national security adviser, Bud McFarlane, persuaded himself, and then the president, that ''dynamic political evolution'' inside Iran had created a power struggle that the Soviets were better positioned to exploit than was Washington. But the Americans could ace out the Soviets by selling weapons to Iran. From here it was only a long laugh track to the arms-for-hostages comedy of errors, thanks to which the United States wound up supplying both sides in the war. The Iranian political opening turned out to be a figment of McFarlane's imagination -- though so, alas, was Saddam Hussein's gratitude.

Iran was a more dangerous and destabilizing force than Hussein's Iraq because it enjoyed not only the ''hard power'' of armies and weapons but also the ''soft power'' of its revolutionary ideology. Iran increased its strength through irregular militias like the Revolutionary Guard and proxy forces like Hezbollah in Lebanon. Both mastered what we now call asymmetrical warfare, enabling Iran's leaders to operate outside the rules that govern state behavior. The Revolutionary Guard, contemptuously dismissing the shah's elite navy, equipped itself with small, nimble patrol boats, anti-ship missiles and crude mines, allowing Iran to terrorize tanker fleets in the Persian Gulf and, for several years, harass the United States Navy.

The proxies also gave Iran deniability. After a truck bomber, probably linked to Hezbollah, blew up the Marine barracks in Beirut in October 1983, killing 241 servicemen, Reagan and his advisers writhed in uncertainty over the proper response -- and ultimately did nothing.

How do you solve a problem like Iran? President John Adams refused to be drawn into war with revolutionary France despite serious provocations, and Presidents Harry Truman and Dwight Eisenhower pursued a ''containment'' policy that avoided direct confrontation with the Soviets, even at the cost of sacrificing Eastern Europe. Containment is a policy of patience; it succeeds when a revolutionary regime runs out of steam and a successor government seeks to rejoin the community of nations. But in Iran, the grip of the mullahs has not yet weakened, no matter how disaffected ordinary citizens may be.

The United States was able to avoid war against Iran in the first decades after the revolution because the threat the regime posed was regional rather than global. That changed decisively with the discovery that Iran was secretly enriching nuclear fuel, and perhaps seeking to build a bomb. Iran's course had to be altered. But how? Crist lays out the now familiar debate inside the administration of George W. Bush between advocates of diplomacy like the national security adviser, Condoleezza Rice, and hard-liners like Vice President Dick Cheney. He describes a ''vibrant policy'' of carrots and sticks undermined by ''internal squabbles.'' He also disputes press accounts that the administration seriously contemplated regime change in Iran, or even attacks on nuclear sites. Perhaps Bush's Iran policy was less one-sided and bellicose than it appeared at the time.

Crist has interviewed a great many American policy makers and generals, and he seems to know the name of the captain of every Iranian patrol boat; he offers vivid set pieces of David-and-Goliath naval battles in the Persian Gulf, including some nifty improvisations by Goliath as well as by David. He offers in tapestry form what most of us know only in tableaus, and in any case have mostly forgotten. He is not a prose stylist. Characters have a way of walking onstage carrying a hackneyed attribute in each hand (''He had two great loves: his wife and the Navy'').

But a more serious flaw is that Crist cannot tell us what we need to know about Iran. In his last pages he writes that ''deeper even than the Shia religious motivations is an ingrained sense of Persian historical entitlement.'' The wish for imperial rejuvenation need not be a destabilizing force: it fuels Russia's drive to subordinate its neighbors, but also Turkey's peaceful attempt to regain influence in the old Ottoman space. If Iran wants a seat at the table, it can be accommodated. But does it? Crist doesn't really profess to know.

We will not be able to figure out how to alter Iran's behavior unless we understand its motives. If Iran's orientation is fundamentally defensive, it can be contained, as the Soviet Union was. And if Iran is a rational calculator, it can be moved, as other states can be moved, by a combination of blandishments and threats. But the Israeli prime minister, Benjamin Netanyahu, insists that Iran is a messianic state obsessed with annihilating its enemies, above all Israel. In that case, almost any price, including war, would be worth paying to prevent Iran from developing a nuclear weapon.

President Obama has agreed that Iran cannot be contained, and thus that patience is not a workable policy. But he also seems far more concerned than Netanyahu -- or Mitt Romney -- about the potentially cataclysmic consequences of a military strike. It may be, in fact, that a contained Iran is less dangerous to the global order than an Iran with nothing to lose.

PHOTO: An Iranian Saeqeh missile is launched during war games in April 2010 in southern Iran near the Strait of Hormuz. (PHOTOGRAPH BY MEHDI MARIZAD/AGENCE FRANCE-PRESSE -- GETTY IMAGES)

Correction September 9, 2012, Sunday

This article has been revised to reflect the following correction: A review on Aug. 19 about ''The Twilight War,'' by David Crist, misstated the year of the truck bombing that killed 241 American servicemen in Beirut during the Reagan administration. It was 1983, not 1985.