Editor's note: Julian E. Zelizer is a professor of history and public affairs at Princeton University. He is the author of "Arsenal of Democracy: The Politics of National Security From WWII to the War on Terrorism," published by Basic Books and "Jimmy Carter," published by Times Books.
(CNN) -- Days after the daring operation that resulted in the death of Osama bin Laden, pollsters reported that President Barack Obama's approval ratings were rising.
According to The New York Times, 57% said that they approved of Obama's job performance compared with last month when the number was only 46%; others, including a CNN poll, reported smaller boosts.
The improvement in his ratings is comparable to what President George W. Bush enjoyed following the capture of Saddam Hussein in 2003. Many commentators have already started to speculate as to whether this successful mission, which has earned praise from both sides of the political aisle, might cement a victory for Obama in 2012.
But the historical record raises doubts. The clearest political effects of foreign policy on the electoral standing of presidents tend to be negative.
In other words, when things go right in foreign policy, the positive impact is limited and short-lived. But when things go wrong, they can easily turn into political disasters for presidents.
In 1952, Republicans used the stalemate in Korea to attack Democratic candidate Adlai Stevenson by linking him to President Truman's policies. In 1968, Republican Richard Nixon blasted Lyndon Johnson's disastrous war in Vietnam, promising that Republicans would be able to do better in Southeast Asia.
In 1980, Ronald Reagan continually pointed to President Jimmy Carter's inability to free the American hostages in Iran, as well as to the failed military rescue that had been attempted, as evidence for why the nation needed a Republican in the White House. Most recently, Democrats criticized President George W. Bush in 2008 for the problems with the war in Iraq, lack of progress in Afghanistan and the failure to capture bin Laden.
Of course, there are examples when foreign policy accomplishments have bolstered a president's standing in the polls.
During moments when presidents responded aggressively to massive threats soon after they emerged, such as FDR with World War II and Bush in the years that followed 9/11, presidents were able to show voters their skills as leaders and benefited politically in subsequent campaigns (FDR in 1944 and Bush in 2004). When the memories of horrific attacks loomed large in the minds of Americans, voters gave credit to presidents who seemed to be leading the nation toward safer ground.
At the same time, presidents have been able to sell to the American public foreign policies that keep the peace. In 1964, Lyndon Johnson ran against Barry Goldwater by painting him as an extremist who threatened to trigger world war.
But more often than not, it is difficult to translate positive foreign policy accomplishments into electoral capital, particularly when the larger war that is being fought has not actually ended, as is the case with the current war on terrorism.
One of the most powerful examples of the ephemeral nature of these political benefits came with President George H. W. Bush in 1992. Following the success of Operation Desert Storm, where the U.S. forced Iraqi troops to leave Kuwait, it seemed that Bush would be unbeatable in 1992.
"The number of people who don't like George Bush," joked Newt Gingrich at the time, "is almost down to the number of people running for the Democratic nomination."
When the president delivered a joint message to Congress on March 6, 1991, Republicans greeted him with thunderous applause. Legislators wore yellow ribbons on their lapels and waved American flags. To distinguish themselves from their opponents, Republicans wore buttons that said, "I voted with the President."
His standing did not last long.
Adviser Fred Steeper had warned the president that he could suffer from the "Churchill factor," predicting that Bush might encounter the same problems that British Prime Minister Winston Churchill had confronted after World War II. Although Churchill had been key to the defeat of Germany, he and his Conservative Party lost the election in 1945 -- in large part because of domestic policy.
Steeper was right. Over the next few months, the recession weighed heavily on the minds of voters. Democrats were able to charge that Bush did not have any proactive response to the stagnation of the economy and that he had lost touch with Americans who were suffering.
There were also problems in foreign policy that undermined the U.S. victory in 1991. When Saddam Hussein violated no-fly zones to attack his opponents, some Americans started to question whether the victory was as grand as they had thought. The news media, already in an age of the 24-hour media cycle, had turned its attention away from the war many months before the election started.
The result was that when Bill Clinton, who had not been a main contender, challenged Bush by honing in on the failed economy and Ross Perot took away some votes through his independent candidacy, Democrats regained control of the White House.
This weekend's events were historic, and they were and will always be a defining moment in Obama's presidency, as well as in the history of national security policy. Yet it is far from clear what political effects bin Laden's death will have on Obama's re-election prospects.
As the president himself must have realized, a failed operation would have been a political disaster. On the other hand, the success of the operation likely will not guarantee victory for Obama in 2012.
The opinions expressed in this commentary are solely those of Julian E. Zelizer.