By Mike Mount

The surge of U.S. forces into Afghanistan is all but over. Within days, the last several hundred troops will have left the country, according to U.S. military officials, ending an almost three-year operation to quash what was widely viewed as Taliban resurgence.

In December 2009, just over eight years after the war in Afghanistan started, President Barack Obama ordered more than 30,000 additional troops to stabilize the country enough so U.S. and international trainers could focus on developing the Afghan security forces.

While the U.S. spent years pouring troops and resources into the war in Iraq, the Taliban used that time to rebuild and start re-taking their traditional stronghold in southern Afghanistan.

Ahead of his decision to move these additional troops into Afghanistan, Obama spent several months reviewing numerous options from his advisers on how he should proceed with the "Afghan surge, as it came to be known. It would be one of his administration’s biggest gambles.

"Any time you send our brave men and women into battle, you know that not everyone will come home safely, and that necessarily weighs heavily on you. The decision did help us blunt the Taliban's momentum, and is allowing us to transition to Afghan lead," the president said last month while talking to the online community Reddit.

The war, which had been eclipsed by the United States' other war in Iraq, was front and center on America's scope as U.S. troop and civilian deaths started to rise.

Limits on joint patrols may undercut transition in Afghanistan

There was seemingly no forward movement on advancement of Afghan forces to reach a level where they could take control of the security in the country – a key element in allowing Afghanistan to thrive as a self-governed nation and keep it from returning to a terrorist haven.

Almost three years after the president decided to go ahead with the surge, the remaining units of those almost 33,000 troops will have left the country, bringing the U.S. troops level down to about 68,000 from a surge peak of about 100,000, according to Pentagon statistics. But did the Obama administration's gamble to wrest control back in Kandahar and Helmand provinces pay off?

The goal was to reverse the momentum of the Taliban and provide enough time for the international forces to train Afghan security forces to a level where they can start providing the self-sufficient security the country will need when the U.S. and other forces leave at the end of 2014.

Earlier this month, the deputy commander of international forces in Afghanistan said the NATO-led forces were progressing, but were also seeing an insurgent campaign that was attempting to, "divide the coalition from our Afghan partners."

What Lt. Gen. James L. Terry was saying, without saying it, is that that the fighting continues.

A clear example of how the insurgency is able to strike at will in most parts of the country is last week's brazen assault on a coalition base in southern Afghanistan that killed two U.S. troops and destroyed six coalition fighter jets, and a suicide attack in Kabul on Tuesday by an insurgent group that killed 12 people.

Last month, the senior combat leader in Afghanistan, Gen. John Allen, said insurgent violence in the south was down 3% over 2011 levels, but admitted it was not "statistically significant."

However, while the violence levels may not have changed much, Allen said the significant change was where the violence was now.

"We have pushed hard on the insurgency to push them out of the population centers, much of which was cleared last year, and we've continued to push them into an increasingly smaller series of areas, districts, where we have, in many respects, contained them," Allen said.

As the surge troops leave, some outside of the military ranks think it has failed to bring enough security to the country in order for governance to take root and prosper.

"We have not seen as much success as we had hoped for," says Mark Jacobson, a senior fellow at the Washington, D.C. analyst organization, German Marshall Fund, and a former NATO adviser to Gen. David Petraeus while he was the top commander in Afghanistan.

"Did the surge provide the necessary impetus in terms of security and the support of government and other activities so the Taliban and the insurgency would be brought to the table? I don't think that has happened as quickly as people had originally hoped," Jacobson said.

But like Allen, Jacobson does see some success in the struggle to reduce the violence with the surge troops.

Violence rages as surge troops depart Afghanistan

"There are certainly signs the insurgency is not the monolithic structure it was back in 2009 when people said they were at the gates of Kabul," he said.

While the surge does not seem to have beaten back violence levels to a point that is satisfying most, it does appear that one of the main goals, building up the Afghan security forces to a level where they can secure Afghanistan on their own, is widely accepted as having succeeded.

"It (the surge) gave the time and space required for the Afghan national security forces to develop in terms of their capabilities. This is not the same Afghan army that was there in 2009," according to Jacobson.

"Not every unit is equivalent. The ANA forces are doing increasingly better, the police forces are, of course, lagging behind with the exception of the special units. But it's a heck of a lot better," Jacobson said.

Last April, Marine Gen. John A. Toolan, commander of allied forces in southern Afghanistan, said he had seen improvement in Afghan security forces, but there was going to be a need for additional improvement over the next two years before NATO forces left.

According to Toolan, the United States will have to focus on improving roles in intelligence, combat medicine, special operations, artillery and criminal investigation in the Afghan police forces.

"As the conventional forces leave, special operations forces will continue to be required because their (Afghan military) special operations capabilities are going to take a little bit more time to nurture and mature," according to Toolan.

Overall, Jacobson gives a good rating for the surge in terms of meeting its goals, not necessarily on the battlefield, but on the political gridiron.

The medical legacy of a decade at war

"There are going to be a lot of questions historians will argue over for the next 50 years about this war, including whether the surge accomplished what it set out to do. It did," Jacobson said.

"It was also politically successful because it helped drive the international political commitment that was necessary to get the allies to support a transition," Jacobson said, referring to the 2010 NATO agreement in Lisbon, Portugal, where allies agreed on a way forward for Afghanistan to stand on its own.

He explained how the Lisbon agreement paved the way to the strategic partnership agreement between the U.S. and Afghanistan, which put Afghan President Hamid Karzai in a position to understand the U.S. would be in Afghanistan for the long term.

With Karzai at ease that the U.S. and its allies would not be walking away from Afghanistan, he was willing to work with the U.S. and dropping his hostile attitude toward the alliance.

"You can't under estimate political resolve and the importance of helping Afghanistan get things done," according to Jacobson.

But while the verdict may still be out on how well the surge worked, Obama still believes sending in more than 30,000 troops was the right thing to do, while publicly pointing out it did achieve at least some of the overall goals.

But as he told participants in the online chat last month, the decision to send those additional troops still weighs on him.

"Knowing of the heroes that have fallen is something you never forget,” he said.

The impact of insider attacks in Afghanistan