Today marks five years since George W. Bush declared the end of major combat operations in Iraq. This pronouncement was decidedly premature, and as the president recently admitted, “it’s taking longer than I anticipated.” But he is still optimistic. Iraq, he insisted, “is a mission that is succeeding on the security front.”

His optimism is based on the surge, which has reduced violence in some parts of Iraq. Yet praise of the surge has an uneasy resonance for Americans who remember Vietnam.

“I am absolutely certain that whereas in 1965 the enemy was winning, today he is certainly losing,” Gen. William Westmoreland, the military commander in Vietnam, asserted in a speech at the National Press Club in November 1967. “We have reached an important point when the end begins to come into view.”

The war went on for another five years.

Is history repeating itself? In his famous article on guerrilla warfare in the 14th edition of the Encyclopedia Britannica, T. E. Lawrence emphasized that insurgents “must have an unassailable base.” In Vietnam, that unassailable base was North Vietnam. The United States could bomb, but that was all it could do.

Is there an equivalent to North Vietnam in the Iraq war? The Bush administration has long accused Iraq’s neighbors of interference, and increasingly those accusations focus on Iran. In recent testimony before Congress, Gen. David Petraeus highlighted the role of Iranian “special groups” in attacks on Iraqi and American armed forces.

If that is the case, Lawrence’s analysis shows that the U.S. has an enormous problem. Years of bombing were not enough to eliminate the North Vietnamese base. Does the U.S. even have that option with Iran?

Even with the military presence in Iraq at its peak, U.S. forces are suffering mortar attacks on Baghdad’s Green Zone. At no time during Vietnam — not even during the Tet offensive — were American forces in Saigon subject to mortar attacks for days on end. At no time were they obliged to live in a high-walled fortress and forced to sleep inside its most blast-resistant buildings.

How can this threat be addressed? If the insurgent base is unassailable, the U.S. will have to deal with the situation inside Iraq. But here it runs into other problems, which Lawrence identifies when he warns of employing an “army of occupation too small” to control the population.

That description is almost too painful to acknowledge. Here again the Vietnam precedent is illuminating. Even 500,000 troops were inadequate to prevent the Tet offensive, although they sufficed to defeat it.

And then Westmoreland stunned the American people by asking for even more troops. His request was denied. The U.S. was winning battles, but the enemy was still fighting and showing no desire to stop. What’s the point of winning battles if it doesn’t bring you closer to winning the war?

In Iraq, dispatching more troops isn’t even an option. The surge is what its name implies — a temporary measure — and American forces will be reduced in number.

What then? The hope — the only hope — is that Iraqi forces will be able to take over. That was also our hope in Vietnam. It might have succeeded, given more assistance and more time, but the enemy was not so accommodating.

Failure, say supporters of the Iraq war, is not an option. It is an odd statement: By definition, any risky venture carries with it the possibility of failure, and no human endeavor is more fraught with risk than war.

Indeed, even the president now acknowledges the possibility of failure, stressing that it would embolden our enemies and tell our friends that “you can’t count on America.” It is hard to dispute that, but just as we should have done before Vietnam, the time to think through the implications of wars is before we start them.