WASHINGTON -- The end game in Afghanistan is off to a shaky start.

Just as the last U.S. "surge" troops leave the country, trouble is breaking out in ways that go to the core of the strategy for winding down the U.S. and allied combat role and making Afghans responsible for their own security. At stake is the goal of ensuring that Afghanistan does not revert to being a terrorist haven.

Nearly two years after President Barack Obama announced that he was sending another 33,000 troops to take on the Taliban, those reinforcements are completing their return to the United States this week. That leaves about 68,000 American troops, along with their NATO allies and Afghan partners, to carry out an ambitious plan to put the Afghans fully in the combat lead as early as next year.

But the setbacks are piling up: a spasm of deadly attacks on U.S. and NATO forces by Afghan soldiers and police, including three attacks in the last three days; an audacious Taliban assault on a coalition air base that killed two Marines and destroyed six fighter jets; and a NATO airstrike that inadvertently killed eight Afghan women and girls.

The Pentagon on Monday identified the two Marines killed at Camp Bastion on Friday as Lt. Col. Christopher K. Raible, 40, and Sgt. Bradley W. Atwell, 27, Raible was commander of the Harrier squadron that had six of its planes destroyed in the assault.

On Tuesday, the international military coalition in Kabul said that a Taliban "leader" behind the Bastion assault was arrested by Afghan and coalition forces in the district of Helmand province where the base is situated. Without providing details, it said the person is suspected of having provided support to the attackers. Officials had previously said that one of the attackers was captured alive; the rest were killed.

Tensions over the anti-Islam movie produced in the U.S. that ridicules the Prophet Muhammad also spread to Kabul, where demonstrations turned violent Monday when protesters burned cars and threw rocks at a U.S. military base.

Early Tuesday, a suicide bomber rammed a car packed with explosives into a minibus carrying foreign aviation workers to the airport in the Afghan capital, killing at least nine people in an attack a militant group said was revenge for the film.

Those events help the Taliban's aim of driving a wedge between the Americans and their Afghan partners. They also show that the Taliban, while weakened, remains a force to be reckoned with, 11 years after the first U.S. troops arrived to drive the Taliban out.

The extra troops began moving into Afghanistan in early 2010, pushing the total U.S. force to a peak of 101,000 by mid-2011.

The U.S. troop surge was supposed to put so much military pressure on the Taliban that its leaders -- most of whom are in Pakistan -- would feel compelled to come to the peace table. That has not happened. Preliminary contacts began, but have been stymied.

When he announced his decision in December 2009 to send the 33,000 extra troops, Obama said it was aimed at seizing the initiative in a war that was "not lost, but for several years ... has moved backwards."

Battlefield momentum was regained but doubts persist about how long-lasting the progress will prove to be.

Stephen Biddle, a professor of international affairs at George Washington University and an occasional consultant to U.S. commanders in Afghanistan, said Monday he has grown more pessimistic about the handoff of security duties to the Afghans in 2014.

"It looks like what we're going to be handing off is a stalemated war," he said in a telephone interview Monday, "which means the U.S. Congress will be asked to write these checks (to support Afghan forces) for years and years and years with no plausible argument that we're going to bring this to a successful conclusion, at least on the battlefield."

Troubling is piling up so rapidly that some analysts wonder where it will lead.

"We've had this series of unfortunate events, the grand total of which it's really hard to read in any remotely positive manner," said Douglas Ollivant, a former Army officer who served in Iraq during the 2007-08 American troop surge and in 2010-11 was the senior counterinsurgency adviser to the U.S. commander of the eastern sector of Afghanistan. He is now a senior fellow at the New America Foundation, a think-tank .

Worries about Afghan soldiers and police turning their guns on their U.S. and allied partners have reached the point where Gen. John Allen, the top U.S. commander there, directed lower-level commanders on Sunday to review security protections and to limit some partnered operations with the Afghans temporarily.

And it prompted Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, to say Sunday that insider attacks have become a "very serious threat" to the war campaign. "Something has to change," he declared. He also suggested that the Afghan government needs to be more aggressive about making those changes.

But Defence Secretary Leon Panetta struck a different tone, saying Tuesday the attacks do not mean the Taliban is succeeding. Instead, he said the Taliban is "resorting to efforts that try to strike at our force, try to create chaos, but do not in any way result in their regaining territory that has been lost."

Whatever the connection between these attacks, which so far this year have killed 51 allied troops, and the Taliban, they were not a problem when the surge began.

In just the past three days there have been at least three insider attacks, killing two British and four American troops. The third attack, on Monday, wounded at least one civilian contractor but resulted in no fatalities.

Obama also directed that the reinforcements start coming home by July 2011, and he ordered that all return by this month.

U.S. and coalition officials say the overall war plan remains on track, with Afghan forces taking more of a lead role in fighting the Taliban insurgency over the next two years. The combat role for international forces is scheduled to end in December 2014, although some thousands of troops are to remain in various support roles.

Often forgotten is that U.S. troop levels increased more in Obama's first year in office -- from about 32,000 to about 68,000 -- than during the surge. Portions of those early increases were leftover requests from U.S. commanders for reinforcements that President George W. Bush did not act on before leaving office.