The Obama administration’s hope for a smooth and successful ending to what it has always considered the “good war” in Afghanistan has become a determined, nose-to-the-grindstone effort to forge ahead toward the exit.

As challenges mount, the administration has concluded that the only viable course is to continue trying to implement the strategy it has already set in motion, with a date certain for combat withdrawal by the end of 2014.

“Our main objective is getting it right,” said Benjamin J. Rhodes, the White House deputy national security adviser for strategic communications. “We are assembling the pieces of the endgame.”

In political terms, it is a delicate balance. Polls indicate that the majority of Americans favor a quicker end to the war. But early retreat has its own drawbacks, both politically and for U.S. national security.

“On the merits, the strategic calculus of the war has not changed,” said Stephen D. Biddle, a senior fellow at the Council on Foreign Relations who has advised the Defense Department. But there are “unrealistic assumptions” about the future, even if the endgame proceeds as planned, he said.

Administration officials were tentatively relieved Monday when the day ended without widespread anti-American demonstrations in Afghanistan after the shooting deaths of 16 Afghan civilians Sunday, apparently at the hands of a rogue U.S. soldier. Despite angry words from Kabul, U.S. officials expressed cautious confidence that the latest incident would not bring a repeat of last month’s lethal demonstrations after U.S. troops, in what officials deemed an accident, burned copies of the Koran.

The United States moved swiftly after Sunday’s shootings. President Obama made a condolence call to Afghan President Hamid Karzai and promised that justice would be served. Other top U.S. officials also expressed shock and remorse.

“Our point is that it was entirely an exception to any conduct by the U.S. military. . . . It’s a horrific tragedy, and we understand that the Afghan people are going to be outraged,” Rhodes said. “We want to deal with it appropriately, hold anybody accountable to the full extent of the law and continue our relationship with Afghanistan.”

The administration sees three pieces to the endgame there: transitioning security responsibility to Afghan forces, reaching a peace deal with the Taliban and negotiating a political agreement to allow for a long-term U.S. military presence after 2014.

At a NATO summit in May, the United States and its coalition partners expect to firm up plans for the pace of the transition, the timing of the coalition withdrawal and the size of the Afghan force they are willing to train and pay for. Karzai’s government has little ability to fund its own military force.

On the political front, reconciliation talks with the Taliban have reached a preliminary stage but are stalled, awaiting Karzai’s own reconciliation with the government of Qatar, where the talks are supposed to be held. Karzai called his ambassador home from the Persian Gulf state in December, accusing Qatar of interference in internal Afghan affairs.

Progress toward an agreement allowing some U.S. forces to remain in Afghanistan long-term was announced Friday, when Gen. John R. Allen, the commander of coalition forces in Afghanistan, signed an accord to turn over U.S.-run prisons to the Karzai government.

But that was quickly overshadowed by Sunday’s shootings, and some analysts were less optimistic than the administration that Afghan outrage would dissipate quickly.

“We’re in a really ugly place,” said a former military official with long experience in Iraq and Afghanistan who spoke on the condition of anonymity to be candid. “Karzai is going to have zero room to make compromises.”

Rather than building their relationship with Afghan troops, U.S. and coalition forces are “going to be operating with one hand on their pistol and looking over their shoulders,” the former official said.

“The plan is to transition the Afghans by putting [U.S. and NATO] trainers among them. That’s now very questionable. It is to reinforce our presence by continuing to develop the Afghan Local Police, and that plank is now in question. And it’s to negotiate a residual force, now equally dubious. What are we left with?”

Biddle said that after 2014, once the ground-level counterinsurgency and development undertaken by U.S. and coalition troops throughout Afghanistan end, the Obama administration “seems to believe they can continue to do leadership strikes” on Taliban commanders, “with drones and raids in perpetuity.”

Calling it an “unreasonable projection,” he added: “Afghans hate that stuff — what does this approach offer them? We’re going to do everything we like, nothing they want.”

The other faulty assumption, Biddle said, is that Congress will continue to fund the Afghan security forces long after the withdrawal. “The war we’ll be handing off is going to be a stalemate,” he said. When the strategy was conceived, “the Taliban were on a slope to extinction. If that were so, [the administration] could go to Congress and say it was only a couple more years and it would be over. That’s not what we’re looking at now.”

The former defense official said that Obama’s initial description of the Iraq invasion orchestrated by President George W. Bush as a “dumb war,” and of Afghanistan as the place where the United States should make a major commitment of resources, “made him look smarter than Bush.”

“Now,” the former official said, “it doesn’t look so smart.”