They know what it is like to fight a costly, unwinnable war. Now Chuck Hagel and John Kerry are spearheading America's new resolve to pull out of Afghanistan - for good.

American soldier in Afghanistan (getty)

This is being described as the "last chapter" in America's role in building a new Afghanistan, as President Obama met his Afghan counterpart, Hamid Karzai, in Washington to hammer out the final details.

Mr Obama said that US and coalition forces would move to a support role in Afghanistan by this spring and talked about a "responsible end" to the conflict in 2014, when the transition to Afghan control would be complete.

Exact troop levels, he said, were still to be "fully defined", promising an announcement in the coming months. And, he told reporters, the US had come close to its goal of dismantling al-Qaeda.

Karzai's visit comes at a time when the relationship between the two countries is under strain, and after a series of attacks by Afghan soldiers or police on coalition troops.

Military chiefs are busy trying to construct a form of engagement which leaves Afghans themselves in charge of their own security. Chairman of the Joint Chiefs of Staff General Martin Dempsey said he was discussing a comprensive strategic review of future threats and military needs.

And as yet, Afghanistan lacks the resources and equipment to handle security on its own: President Karzai's visit is, in part, a bid to negotiate more military hardware, from helicopters to drones.

We are in a universe of unpredictables and uncontrollables. Chuck Hagel, speaking in 2011

But behind the talk of a more arms-length role for the United States, is the story of the two men who will soon be leading America's foreign and security policy; two men whose experience was born in the trenches of Vietnam, the conflict that seared the conscience of a nation and fired up the hearts of an anti-war generation.

John Kerry and Chuck Hagel, with five Purple Hearts between them, served in that war, and that experience came to change their minds about America's engagement in Iraq and Afghanistan, and its future interventions abroad.

Mr Kerry returned from Vietnam convinced the conflict was wrong, and asking how many more people needed to die for what he called a "mistake". Chuck Hagel, who served there with his brother and was wounded twice, believed he had been doing his patriotic duty, only later coming to believe that American troops should only be sent into conflict if it was absolutely neccessary, and if the goal was realistic.

This defining experience led Mr Hagel to break with his Republican party over Iraq. By 2005 he had become convinced that the war was not only costly and unpopular, but unwinnable, too. The troop surge, he insisted, was the biggest blunder since Vietnam.

Unconventional thinking

From the very start, he had voice misgivings, telling Newsweek: "Many of those who want to rush the country into war and think it would be quick and easy don't know anything about war.

"They come at it from an intellectual perspective, versus having sat in jungles or foxholes and watched their friends get their heads blown off. I try to speak for those ghosts of the past a little bit."

A profile from The New Republic in 2007 reveals how Hagel began to redefine his view on the Vietnam war, concluding that it had been fought for political reasons and that "he and his brother had been 'used' for ignoble ends". Iraq gave him a profound sense of deja vu.

Obama and Karzai (getty)

So too Afghanistan, where Mr Hagel believed it was time to make for the exits. In 2011 he told the Lincoln Journal-Star: "We have lost our purpose, our objective. We are in a universe of unpredictables and uncontrollables".

John Kerry, from his powerful position on the Senate foreign relations committee, was also counselling the administration to at least tweak its strategy, towards a more disengaged future. The existing approach, he suggested, should not simply carry on because it was already in place.

"Everybody agrees there is not a military solution", he told the Boston Globe. "What I worry about is whether or not the governance (improves) sufficiently to make a difference." He convened a series of hearings.

New Hampshire Senator Jeanne Shaheen said John Kerry's own Vietnam experience gave him that extra depth. "He has been on the other side", she said. "He has some understanding of what our men and women serving there are experiencing."

I'm trying to get to an endpoint. President Obama, 2008

In place of that aggressive engagement, then, is a shift towards a more active diplomacy, the kind of reaching out to allies old and new, which Obama touted early on in his first term, but never quite got around to.

But today it seems the president has made two key appointments who will reinforce the advice long espoused by Vice-President Biden: reining back from any long-term intervention in Afghanistan. On the face of it, at least, it appears to signal a definite new direction for the second term.

Both Messrs Kerry and Hagel have proved far more willing to challenge conventional military thinking, far less willing to commit American forces abroad, far more likely to recommend cuts in defence spending, far less likely to risk a confrontation with Iran.

When President Obama announced Hagel's nomination last week, he hinted at that sense of restraint: "(Hagel) understands that sending young Americans to fight and bleed in the dirt and mud, that's something we only do when it's absolutely neccessary."

It was an echo of his thinking from the days of his campaign for office over four years ago, when he told General Petraeus that with finite resources, it was all the more crucial to define tight and modest goals. "I'm trying to get to an endpoint," he said.

Now that endpoint is very much in sight. All that remains, is to discuss the terms.

Felicity Spector writes about US politics for Channel 4 News