The ongoing rift between the U.S. and Afghan President Hamid Karzai — apparent again this week when Karzai ordered the release of detainees accused of attacking American forces —and fears about the Afghan army being able to hold its own against the Taliban have helped frame the question: Did the U.S. achieve its goals in that country after fighting a long and costly war?

The answer from Americans is mostly “no.” About half (52%) said the U.S. had mostly failed to achieve its goals in Afghanistan compared with 38% who said it had mostly succeeded, according to a Pew Research Center/USA TODAY survey conducted in January. There’s relatively little partisan difference on the question: 52% of Republicans, 48% of Democrats and 54% of independents say the U.S. had mostly failed to achieve its goals.

Shortly after the killing of Osama Bin Laden, the public had more confidence that the U.S. effort was on the right path: A June 2011 survey found that 58% said they thought the U.S. would achieve its goals.

Despite the negative view of the outcome, 51% of Americans in the latest poll said using military force in Afghanistan was the right decision — a decision taken after the Taliban refused to turn over al-Qaeda leaders behind the 9/11 attacks. About four-in-ten (41%) said it was the wrong decision. But that support level represents a decline from 2006, when 69% said military intervention was the right decision.

Bruce Drake  is a former senior editor at Pew Research Center.