Michael Dobbs, a former Washington Post reporter, is the author of “One Minute to Midnight: Kennedy, Khrushchev, and Castro on the Brink of Nuclear War.”

The president was in a bind. He had laid down a clear “red line” — which his enemies had flouted. Now he faced an unenviable choice: Take action to enforce his red line, or suffer a catastrophic blow to his political credibility at home and abroad.

“I should have said we don’t care,” the commander in chief mused in the privacy of the White House. “But when we said we’re not going to [tolerate it], and then they go ahead and do it, and then we do nothing . . . ” His voice became an incomprehensible murmur, but his meaning was clear. Doing nothing was not an option.

This tape-recorded exchange took place not in September 2013 but on Oct. 16, 1962, the day John F. Kennedy discovered that the Soviet Union had sent nuclear missiles to Cuba, triggering the most serious crisis of the Cold War. A month earlier, the president had publicly warned the Soviets that “the gravest issues would arise” if they developed a “significant offensive capability” in Cuba. He now doubted the wisdom of his earlier statement.

Fortunately for us all, Kennedy devised a way out of the box that he had helped to construct. He managed to avert a nuclear war while preserving — even strengthening — U.S. credibility on the international stage.

The president getting nowhere fast (Ann Telnaes/The Washington Post)

President Obama needs to perform a similar maneuver if he is to defuse the Syrian crisis in a way that will enhance his political standing while escaping another Middle Eastern quagmire. Russia’s proposal of placing the Syrian chemical arsenal under international control may offer him a chance to do just that.

Whether he is aware of the precedent or not, Obama has taken a leaf out of JFK’s playbook by postponing immediate military action. In 1962, nearly all of the president’s top advisers were calling for airstrikes against Soviet missile sites on Cuba. Kennedy was leaning in that direction himself but was restrained by fear of tit-for-tat escalations that could result in all-out nuclear war.

Instead of airstrikes, Kennedy decided to buy time for back-door negotiations with Soviet leader Nikita Khrushchev by imposing a naval blockade on Cuba. The crisis ended, 13 days later, with Khrushchev agreeing to pull his missiles out of Cuba in a verifiable manner in return for a promise by the United States to refrain from attacking the island. Patience, plus firmness, paid off.

There are obviously many differences between the Cuban missile crisis and today’s standoff over Syria. The Cuban crisis presented a much more immediate threat to the United States. The risk of events spiraling out of control was also much greater. Both Kennedy and Khrushchev understood that time was turning against them, which is why they acted to end the standoff after just a few days.

The most useful lesson that our current president could draw from the Cuban missile crisis would be to emulate Kennedy in slowing down the seemingly inexorable rush to war. With his controversial move to include Congress and the American people in the debate, Obama laid himself open to charges of indecisiveness. But he succeeded in buying a little time. This has allowed a possible alternative to military action to emerge.

Next to popular support, time is the most valuable of all political commodities. Like Kennedy before him, Obama now has an opportunity to escape from the box that he created with his Syrian red line. But for the gambit to succeed, he will also have to maintain the credible threat of force against the Syrian regime. He cannot allow his bluff to be called. It is a delicate balancing act.

Kennedy went into the Cuban missile crisis having just read “The Guns of August,” Barbara Tuchman’s best-selling study of the origins of World War I. The lesson he drew from the book was that misunderstandings and miscommunication can cause statesmen to blunder into war with little understanding of the consequences. He did not want to unleash a nuclear conflagration by mistake, but he was also unwilling to back down in the face of Khrushchev’s fait accompli.

Kennedy understood that the threat of force is often more effective than the use of force. The problem with using force, as George W. Bush discovered in Iraq, is that war is unpredictable. Many things can go wrong. It is better to hold your weapons in reserve for as long as possible — and allow the diplomats to get to work.

It is too early to tell whether Obama’s kick-the-can strategy will succeed. But to quote Winston Churchill, a favorite of the bomb-them-now school of military pundits, “to jaw-jaw is always better than to war-war.”