When President Obama took office six years ago, among the many burdens he inherited were two costly and complex wars: Iraq and Afghanistan.

He campaigned hard against the U.S. invasion of Iraq, calling it the “wrong war” and promised to bring home American combat troops, which took place in 2011.

Divisions, Harsh Realities Plague Obama's Afghan Surge

The other war — Afghanistan — has posed a different set of dilemmas for the president.

Divisions, Harsh Realities Plague Obama's Afghan Surge

?Just this week, Obama was reminded of the grim realities of 13 years of military engagement when a man dressed as an Afghan soldier killed a two-star American general, the highest ranking officer killed in combat since 1970, according to the Pentagon.

Divisions, Harsh Realities Plague Obama's Afghan Surge

The insider attack, claimed by the Taliban, has raised concerns about the hazards of the president’s exit plan — and the fragility of his Afghan policies.

Graeme Smith, a Kabul-based senior analyst with The International Crisis Group and a former journalist, said there is a clear trend that insurgents are making gains in remote parts of Afghanistan.

Case in point: Marjah, a district in southern Helmand province, long a Taliban stronghold, that was cleared in 2010 by NATO and Afghan troops.

“Insurgents are now operating within about eight kilometers from that district center [Marjah],”said Graeme, adding that violence is on the rise four years later.

“You can look at national level data and see quite clearly that more women and children are getting killed and injured this summer than at any period of time since 2001,” he said.

The situation on the ground has not deterred Obama from pursuing his endgame. In May, he said all American combat troops will leave at the end of this year. Nearly 10,000 others will stay on — but only until 2016.

It was the terrorist attacks on New York and Washington September 11, 2001 that got the United States in Afghanistan to start with.

Former president George W. Bush ordered an invasion to top topple the Taliban government and al-Qaida terrorists who were being given sanctuary – in particular, al-Qaida leader Osama Bin Laden.

Bush continued his policy of counterterrorism military operations in Afghanistan, but soon turned his attention towards Iraqi leader Saddam Hussein as the number one national security threat against the United States.

Critics say that switch in focus was a key misstep — one that would inform the narrative of Obama’s policy when he took office in 2009.

“While we weren’t looking, al-Qaida has strengthened itself, it’s strengthened the Taliban, it’s strengthened all these local militant outfits,” said South Asia expert Shamila Chaudhary, who advised former secretary of state Hillary Clinton and the late diplomat Richard Holbrooke on Afghanistan and Pakistan during Obama’s first term.

The groupthink among Obama’s advisors was that Afghanistan had been left to fester and turn into a full-blown insurgency, said Chaudhary, now a Senior Advisor to the Dean at the School for Advanced International Studies (SAIS) at Johns Hopkins University.

“Afghanistan at that time was the forgotten war,” she said. “And so we need to pump in more money, resources, people. There needs to be a military surge, but also a civilian surge.”

A new strategy was needed. It was announced just two months after Obama took office in 2009.

The overhaul of the Afghan war was dubbed Af-Pak.

The Pak referred to Pakistan, reflecting the idea that success in Afghanistan could not be achieved without a stable Pakistan. And that, went the thinking, would require a far deeper American engagement in Pakistan.

To implement the new strategy, Holbrooke was named the special representative for Afghanistan and Pakistan (SRAP) , but the status of his portfolio was somewhat ambiguous.

While it was given an office in the State Department, SRAP was never part of any actual chain of command within the administration, a situation that experts would say undermined Holbrooke’s effectiveness.

Nonetheless, the legendary diplomat and his team of experts began their work with a sense of mission and of history making.

“One of things we recognized then…was that this is a ultimately a political issue within Afghanistan, right?” said Vikram Singh, a counterterrorism expert who was recruited to work for Holbrooke’s team.

Singh, currently the Vice President for National Security and International Policy at Center for American Progress, said that idea was the bottom line for their work.

“So, while we went in because of terrorism hitting us, Afghanistan’s future depends on some kind of durable political framework that can run that country and resolve disputes peacefully,” he said.