President Obama was on edge.

For two exhausting months, he had been asking military advisers to give him a range of options for the war in Afghanistan. Instead, he felt that they were steering him toward one outcome and thwarting his search for an exit plan. He would later tell his White House aides that military leaders were "really cooking this thing in the direction they wanted."

He was looking for choices that would limit U.S. involvement and provide a way out. His top three military advisers were unrelenting advocates for 40,000 more troops and an expanded mission that seemed to have no clear end. When his national security team gathered in the White House Situation Room on Veterans Day, Nov. 11, 2009, for its eighth strategy review session, the president erupted.

"So what's my option? You have given me one option," Obama said, directly challenging the military leadership at the table, including Defense Secretary Robert M. Gates, Joint Chiefs Chairman Adm. Mike Mullen and Army Gen. David H. Petraeus, then head of U.S. Central Command.

"We were going to meet here today to talk about three options," Obama said sternly. "You agreed to go back and work those up."

Mullen protested. "I think what we've tried to do here is present a range of options."

Obama begged to differ. Two weren't even close to feasible, they all had acknowledged; the other two were variations on the 40,000.

Silence descended on the room. Finally, Mullen said, "Well, yes, sir."

Mullen later explained, "I didn't see any other path."

This stark divide between the nation's civilian and military leaders dominated Obama's Afghanistan strategy review, creating a rift that persists to this day. So profound was the level of distrust that Obama ended up designing his own strategy, a lawyerly compromise among the feuding factions. As the president neared his final decision on how many troops to send, he dictated an unusual six-page document that one aide called a "terms sheet," as though the president were negotiating a business deal.

This inside story of Obama's strategy review, and what it shows about his leadership style and decision-making, is based on meeting notes, classified memos and interviews with more than 100 national security officials. Those firsthand accounts reveal a new president confronting the realization that months of tough debate and hard work had not brought forth a clear solution that everyone could agree on. Even at the end of the process, the president's team wrestled with the most basic questions about the war, then entering its ninth year: What is the mission? What are we trying to do? What will work?

At critical points in the review, the ghosts of Vietnam hovered. Some participants openly worried that they were on the verge of replaying that history, allowing the military to dictate the force levels. While Obama sought to build an exit plan into the strategy, the military leadership stuck to its open-ended proposal, which the Office of Management and Budget estimated would cost $889 billion over a decade. Obama brought the OMB memo to one meeting and said the expense was "not in the national interest."