President Obama urgently looked for a way out of the war in Afghanistan last year, repeatedly pressing his top military advisers for an exit plan that they never gave him, according to secret meeting notes and documents cited in a new book by journalist Bob Woodward.

Frustrated with his military commanders for consistently offering only options that required significantly more troops, Obama finally crafted his own strategy, dictating a classified six-page "terms sheet" that sought to limit U.S. involvement, Woodward reports in "Obama's Wars," to be released on Monday. (The Washington Post will print excerpts of Woodward's book beginning Monday on the Web, mobile and print editions.)

According to Woodward's meeting-by-meeting, memo-by-memo account of the 2009 Afghan strategy review, the president avoided talk of victory as he described his objectives.

"This needs to be a plan about how we're going to hand it off and get out of Afghanistan," Obama is quoted as telling White House aides as he laid out his reasons for adding 30,000 troops in a short-term escalation. "Everything we're doing has to be focused on how we're going to get to the point where we can reduce our footprint. It's in our national security interest. There cannot be any wiggle room."

Obama rejected the military's request for 40,000 troops as part of an expansive mission that had no foreseeable end. "I'm not doing 10 years," he told Secretary of Defense Robert M. Gates and Secretary of State Hillary Rodham Clinton at a meeting on Oct. 26, 2009. "I'm not doing long-term nation-building. I am not spending a trillion dollars."

Woodward's book portrays Obama and the White House as barraged by warnings about the threat of terrorist attacks on U.S. soil and confronted with the difficulty in preventing them. During an interview with Woodward in July, the president said, "We can absorb a terrorist attack. We'll do everything we can to prevent it, but even a 9/11, even the biggest attack ever . . . we absorbed it and we are stronger."

But most of the book centers on the strategy review, and the dissension, distrust and infighting that consumed Obama's national security team as it was locked in a fierce and emotional struggle over the direction, goals, timetable, troop levels and the chances of success for a war that is almost certain to be one of the defining events of this presidency.

Obama is shown at odds with his uniformed military commanders, particularly Adm. Mike Mullen, the chairman of the Joint Chiefs of Staff, and Gen. David H. Petraeus, head of U.S. Central Command during the 2009 strategy review and now the top U.S. and NATO commander in Afghanistan.

Woodward reveals their conflicts through detailed accounts of two dozen closed-door secret strategy sessions and nearly 40 private conversations between Obama and Cabinet officers, key aides and intelligence officials.

Tensions often turned personal. National security adviser James L. Jones privately referred to Obama's political aides as "the water bugs," the "Politburo," the "Mafia," or the "campaign set." Petraeus, who felt shut out by the new administration, told an aide that he considered the president's senior adviser David Axelrod to be "a complete spin doctor."

During a flight in May, after a glass of wine, Petraeus told his own staffers that the administration was "[expletive] with the wrong guy." Gates was tempted to walk out of an Oval Office meeting after being offended by comments made by deputy national security adviser Thomas E. Donilon about a general not named in the book.

Suspicion lingered among some from the 2008 presidential campaign as well. When Obama floated the idea of naming Clinton to a high-profile post, Axelrod asked him, "How could you trust Hillary?"