Washington (CNN) -- John Kerry got Swift-boated. Jimmy Carter had his re-election chances decimated in the Iranian desert. Then there was Michael Dukakis and that tank photo.
It is a tradition of presidential politics in recent decades that Democrats get accused of being soft and inexperienced on military and foreign policy issues, and Barack Obama was no different in 2008.
However, a string of foreign policy successes -- including the killings of terrorist leaders Osama bin Laden and Anwar al-Awlaki, and now the toppling of the Gadhafi regime in Libya without the loss of any U.S. service members -- have made Obama seemingly invulnerable to the quadrennial Republican attack line.
The question is whether it will matter a year from now, when voters decide if he should get a second term.
To analysts interviewed Monday, the president's policies and actions during almost three years in power have helped him shed the knee-jerk, anti-war reputation affixed to Democrats since the Vietnam era.
They cite increased drone strikes in Pakistan and Yemen, including the one that killed the U.S.-born al-Awlaki, as well as the Special Forces mission that raided a compound in Pakistan housing bin Laden.
"Those actions demonstrate a degree of toughness that insulates him from the charge of being soft on defense," said Darrell West, vice president and director of governance studies at the Brookings Institution think tank in Washington.
However, voter dissatisfaction with 9% unemployment and crawling economic recovery is likely to overwhelm any benefit the president gets from foreign policy successes, said David Gergen, a CNN senior political analyst.
According to Gergen, the association of Democrats with liberal pacifism dates back decades.
In the middle of the 20th century, he noted, Democrats were the party of international engagement willing to "bear any burden" to defend the nation and its interests, as President John F. Kennedy put it at his 1961 inaugural address.
Then the Vietnam War deeply divided the country, with Democrats becoming inextricably linked to the fervent anti-war movement by nominating liberal South Dakota Sen. George McGovern for president in 1972, according to Gergen.
In subsequent decades, the perception persisted of Democrats as liberals who were soft on communism and unwilling to use military force.
In 1980, the failure of a military mission in Iran ordered by Carter to rescue 52 Americans held hostage since the revolution the previous year cemented his image as a weak leader.
Crashed helicopters in the desert became the foreign policy symbol of a presidency that helped orchestrate the Camp David Accords between Israel and Egypt. Carter then was defeated by Ronald Reagan in the presidential election that year.
Eight years later. Dukakis saw his campaign against then-Vice President George H.W. Bush undermined in part by a photo that sought to prop up his military credentials by showing him riding a tank. However, the image of Dukakis in what appeared to be an over-large military helmet with his name affixed to the front, his tie and business shirt visible beneath military outer garb, instead prompted ridicule.
The "soft on war" legacy for Democrats continued in 2004, when Kerry came under fierce, privately funded attacks that accused him of falsifying his account of a battle that earned him a Silver Star as a Swift boat operator, as well as making false claims about misconduct by other U.S. forces in Vietnam and Cambodia.
The campaign against Kerry coined the phrase "swift-boating" in reference to an acute, partisan and not necessarily truthful political attack. It also turned what should have been a benefit for Kerry -- his war record compared to the non-service in Vietnam by Republican incumbent George W. Bush -- into a controversial issue. Kerry lost the election.
For Obama, what was perhaps his greatest foreign policy triumph -- the covert mission to send U.S. special forces into Pakistan after bin Laden -- came close to the kind of failure that plagued Carter's rescue mission 31 years earlier.
One of the U.S. helicopters involved became disabled, forcing a change in how the mission was carried out. This time, though, the U.S. forces were able to infiltrate bin Laden's compound, kill him and fly out with his body.
Former Defense Secretary Robert Gates, who served in both Republican and Democratic administrations, called Obama's decision to launch the mission one of the most courageous he ever saw a president make.
If the bin Laden mission had failed, West and Gergen noted, Obama would likely find himself in the same position as Carter -- an incumbent candidate labeled as weak and ineffective.
"They would have tried to turn Obama into Jimmy Carter," West said, adding: "People would have said that even though the mission was ambitious, the execution was flawed and that this would reflect poorly on presidential leadership."
Instead, "I don't think it's going to be possible for Republicans to Swift-boat Obama," West said. The president's actions "demonstrate a degree of toughness that Jimmy Carter didn't have."
Both Gergen and West said Obama's strategy seeks to exert U.S. influence while minimizing the nation's long-term commitment to overseas conflict and any loss of American lives.
That strategy was most evident in the Libya campaign, which was launched by the United States under a U.N. resolution authorizing establishment of a no-fly zone to protect civilians from attack by Gadhafi's military.
Eventually, the campaign shifted to NATO control, with U.S. forces playing a supporting role for air strikes that targeted Gadhafi forces. In the end, the total cost to the U.S. government is expected to be under $2 billion with no loss of American lives, compared to the more than $800 billion in costs and more than 4,000 U.S. fatalities in the Iraq War launched by the Bush administration.
Some Republicans have tried to defuse credit for Obama's policy, complaining it lasted longer than necessary because the administration withheld the full might and leadership of U.S. forces throughout the Libya campaign.
But to West, the successful completion of the mission -- with Gadhafi gone and no long-term U.S. commitment or cost -- will bolster Obama in next year's election.
"I've seen that a lot of people are arguing foreign policy is not going to be relevant in 2012," according to West. "I think those interpretations miss the leadership Obama has displayed in foreign affairs."
Gergen warned that Obama remains vulnerable to problems in Iraq and Afghanistan, where the president is ending or reducing long-running U.S. wars.
Last week, Obama announced that virtually all U.S. troops would leave Iraq by the end of the year, which would fulfill a campaign pledge from 2008. At the same time, the number of U.S. troops in Afghanistan is being decreased following an earlier surge ordered by Obama, with the goal of ending the war by the end of 2014.
Republicans such as veteran Sen. John McCain of Arizona -- who lost to Obama in 2008 -- have criticized both moves, saying they undermined the long-running missions by providing U.S. enemies with an end date to the nation's military commitments in those countries.
"I do think he's fortified himself against these Republican attacks," Gergen said of Obama, but he added that "Iraq or Afghanistan or both could become a crisis between now and the election.
Overall, though, the president has strengthened his standing as commander-in-chief, Gergen and research assistant Michael Zuckerman wrote in a CNN column last week.
Obama's foreign policy approach will "bolster a campaign argument that may resonate not only with his base, but also with swing voters increasingly wary of foreign engagements: that Obama wields force much more prudently and surgically than the reckless GOP -- that he has wound down Iraq and helped win back international respect, all while delivering strong results," the column said.