By PETER BAKER
WASHINGTON - President Obama rushed to the Oval Office when word arrived one night that militants with Al Qaeda in Yemen had been located and that the military wanted to support an attack by Yemeni forces. After a quick discussion, his counterterrorism adviser, John O. Brennan, told him the window to strike was closing.
"I've got two minutes here," Mr. Brennan said.
"O.K.," the president said. "Go with this."
While Mr. Obama took three sometimes maddening months to decide to send more forces to Afghanistan, other decisions as commander in chief have come with dizzying speed, far less study and little public attention.
He is the first president in four decades with a shooting war already raging the day he took office - two, in fact, plus subsidiaries - and his education as a commander in chief with no experience in uniform has been a steep learning curve. He has learned how to salute. He has surfed the Internet at night to look into the toll on troops. He has faced young soldiers maimed after carrying out his orders. And he is trying to manage a tense relationship with the military.
Along the way, he has confronted some of the biggest choices a president can make, often deferring to military advisers yet trying to shape the decisions with his own judgments - too much at times for the Pentagon, too little in the view of his liberal base. His evolution from antiwar candidate to leader of the world's most powerful military will reach a milestone on Tuesday when he delivers an Oval Office address to formally end the combat mission in Iraq while defending his troop buildup in Afghanistan.
A year and a half into his presidency, Mr. Obama appears to be a reluctant warrior. Even as he draws down troops in Iraq, he has been abundantly willing to use force to advance national interests, tripling forces in Afghanistan, authorizing secret operations in Yemen and Somalia, and escalating drone strikes in Pakistan. But advisers said he did not see himself as a war president in the way his predecessor did. His speech on Tuesday is notable because he talks in public about the wars only sporadically, determined not to let them define his presidency.
Where George W. Bush saw the conflicts in Iraq and Afghanistan as his central mission and opportunities to transform critical regions, Mr. Obama sees them as "problems that need managing," as one adviser put it, while he pursues his mission of transforming America. The result, according to interviews with three dozen administration officials, military leaders and national security experts, is an uneasy balance between a president wary of endless commitment and a military worried he is not fully invested in the cause.
"He's got a very full plate of very big issues, and I think he does not want to create the impression that he's so preoccupied with these two wars that he's not addressing the domestic issues that are uppermost in people's minds," Defense Secretary Robert M. Gates said in an interview. Mr. Obama, though, has devoted enormous time and thought to finding the right approaches, Mr. Gates added. "From the first, he's been decisive and he's been willing to make big decisions," he said.
Senator Jack Reed, a Rhode Island Democrat who sometimes advises Mr. Obama, said the president was grappling with harsh reality. "He came into office with a very sound strategic vision," Mr. Reed said, "and what has happened in the intervening months is, as with every president, he is beginning to understand how difficult it is to translate a strategic vision into operational reality."
A former adviser to the president, who like others insisted on anonymity in order to discuss the situation candidly, said that Mr. Obama's relationship with the military was "troubled" and that he "doesn't have a handle on it." The relationship will be further tested by year's end when Mr. Obama evaluates his Afghanistan strategy in advance of his July deadline to begin pulling out. As one administration official put it, "His commander in chief role is about to get tested again, and in a very dramatic way."
Beyond the Vietnam Debate
Mr. Obama was an 11-year-old in Hawaii when the last American combat troops left Vietnam, too young to have participated in the polarizing clashes of the era or to have faced the choices the last two presidents did about serving. "He's really the first generation of recent presidents who didn't live through that," said David Axelrod, his senior adviser. "The whole debate on Vietnam, that was not part of his life experience."
Running for president of a country at war, he had plenty to learn, even basics like military ceremonies and titles. His campaign recruited retired generals to advise him. But it still took time to adjust when he became president. The first time he walked into a room of generals, an aide recalled, he was surprised when they stood. "Come on, guys, you don't have to do that," he said, according to the aide.
Perhaps his most important tutor has been Mr. Gates, the defense secretary appointed by Mr. Bush and the first kept on by a president of another party. They are an unlikely pair, a 49-year-old Harvard-trained lawyer turned community activist and a 66-year-old veteran of cold war spy intrigues and Republican administrations. But they are both known for unassuming discipline, and they bonded through weekly meetings and shared challenges.
Mr. Obama has relied on Mr. Gates as his ambassador to the military and deferred to him repeatedly. When Mr. Gates wanted to force out Gen. David D. McKiernan in May 2009 as commander in Afghanistan in favor of Gen. Stanley A. McChrystal, Mr. Obama signed off. Likewise, cognizant of Bill Clinton's ill-fated effort to end the ban on gay and lesbian soldiers, Mr. Obama let Mr. Gates set a slow pace in overturning the "don't ask, don't tell" policy, even though it has disappointed gay rights advocates.
Even on his signature campaign promise to pull out of Iraq, Mr. Obama compromised in the early days of his tenure to accommodate military concerns. Instead of the 16-month withdrawal of combat forces he promised, he accepted a 19-month timetable, and he agreed to leave behind 50,000 for now rather than a smaller force.
But as he grows in the job, Mr. Obama has shown more willingness to set aside Mr. Gates's advice. When General McChrystal got in trouble in June for comments by him and his staff in Rolling Stone magazine, Mr. Gates favored reprimanding the commander. Mr. Obama decided instead to oust him and replace him with Gen. David H. Petraeus, who led the troop increase in Iraq.
"My first reaction was if McChrystal with his experience and his contacts and his knowledge were pulled out, that could have real consequence for the war," Mr. Gates said. "It never even occurred to me - I kicked myself subsequently - to move Petraeus over there. When the president raised that with me in a private meeting, it was like a light bulb went on - yes, that will work."
Just as keeping Mr. Gates provided political cover against the weak-on-defense Democratic image, Mr. Obama surrounded himself with uniformed officers. He kept Mr. Bush's war coordinator, Lt. Gen. Douglas E. Lute, and tapped Gen. James L. Jones as national security adviser. "Picking General Jones was in part inoculation," said Bruce O. Riedel, a senior fellow at the Brookings Institution who led Mr. Obama's first Afghanistan review.
But they were not always in control. General Jones has often been eclipsed by younger foreign policy advisers with closer relationships with the president. Mr. Obama ended up pushing out Adm. Dennis C. Blair as director of national intelligence, and approved the Afghan troop increase despite the warnings of Lt. Gen. Karl W. Eikenberry, his ambassador to Kabul.
Although General McChrystal was described in Rolling Stone as calling Mr. Obama intimidated in meeting with military commanders early in his tenure, other attendees disagreed. "He didn't look to me like he was one bit intimidated," Mr. Riedel said. "He did look like someone who was taking it all in and a bit frustrated that what seemed for him to be simple questions he was getting complicated answers to - like how many troops do you really need?"
Wars as a Distraction
With the economy in tatters and health care on his agenda, Mr. Obama was determined to keep the wars from becoming a major distraction. When he held a videoconference on Iraq on his first full day in office, officials recalled, he said: "Guys, before you start, there's one thing I want to say to you and that is I do not want to screw this up."
But while he had given much thought to ending the war in Iraq, he had not spent as much time contemplating Afghanistan despite a campaign promise to send more troops. When he took office, he found an urgent request to reinforce the flagging effort. Warned by the generals that he could not wait to study the issue, he overruled Vice President Joseph R. Biden Jr. and sent 21,000 more troops. "Both he and I frankly thought at that point we were done," Mr. Gates recalled. Within months, though, General McChrystal asked for 40,000 more troops. "I certainly was surprised when General McChrystal came in with the request," he said, "and I think the president was as well."
Reliant on Mr. Gates, Mr. Obama has made limited efforts to know his service chiefs or top commanders, and has visited the Pentagon only once, not counting a Sept. 11 commemoration. He ended Mr. Bush's practice of weekly videoconferences with commanders, preferring to work through the chain of command and wary, aides said, of being drawn into managing the wars.
So General McChrystal's request for even more reinforcements exposed the mutual mistrust, particularly after it was leaked to the news media. The president complained he was being boxed in while the military worried whether politics would drive the decision. At one point Denis R. McDonough, deputy national security adviser, pressed Adm. Mike Mullen, chairman of the Joint Chiefs of Staff, about stopping leaks by the military, according to people informed about the conversation. Admiral Mullen asked pointedly if that would also apply to the White House chief of staff, Rahm Emanuel, who was skeptical of the troop increase request.
"If I had been in the White House, I would have been suspicious," Mr. Gates said. "The leak of McChrystal's assessment was obviously very damaging in the assessment process because it put the president on the spot." He added: "My position was this is not a deliberate attempt to jam the president. It's indiscipline."
Last December, the president gave the military 30,000 more troops, but also a ticking clock. He would start pulling troops out in July, on the grounds that if there was not visible progress by then, it would mean the strategy was not working. Some saw that as a sop to his antiwar base. Others considered it his way of reasserting control over a military that knows how to outmaneuver the White House.
"He didn't understand or grasp the military culture," said Lawrence J. Korb, a former Pentagon official at the liberal Center for American Progress. "He got over that particular quandary and put them back in the box by saying, ‘O.K., I'm giving you 18 months.' "
One adviser at the time said Mr. Obama calculated that an open-ended commitment would undermine the rest of his agenda. "Our Afghan policy was focused as much as anything on domestic politics," the adviser said. "He would not risk losing the moderate to centrist Democrats in the middle of health insurance reform and he viewed that legislation as the make-or-break legislation for his administration."
White House officials reject the linkage, but said Mr. Obama believed that the wars should be judged against other priorities. Preparing to announce his decision last December, he read Dwight D. Eisenhower's farewell address and included a line in his own speech at West Point: "Each proposal must be weighed in the light of a broader consideration: the need to maintain balance in and among national programs."
Hungry for Information
Mr. Obama has made a point of seeking his own information, scribbling questions in memo margins and scouring the Internet. At one meeting, he surprised the generals by citing a study of post-traumatic stress disorder among soldiers serving repeat tours.
"He reads a lot," said General Jones, the national security adviser. "He studies issues before he comes to the table. That's another thing the military mind, if there is such a thing, appreciates. When he sits down to talk about an issue, he's done his homework."
Facing relentless and elusive foes, Mr. Obama has turned increasingly to the sort of strikes he authorized in Yemen and the drones in Pakistan, a form of warfare with little risk to American lives even though critics question its wisdom, effectiveness or even morality.
But Mr. Obama also confronts the consequences of the direct combat he has ordered. Last year, he flew to Dover Air Force Base in Delaware to greet soldiers' coffins. During a later meeting with advisers, Mr. Obama expressed irritation at doubters of his commitment. "If I didn't think this was something worth doing," he said, "one trip to Dover would be enough to cause me to bring every soldier home. O.K.?"
In March, during his only trip to Afghanistan in office, he met a wounded soldier, maybe 19, who had lost three limbs. "I go into a place like this, I go to Walter Reed - it's just hard for me to think of anything to say," an emotional Mr. Obama told advisers as he left.
The moment stuck with him. Three months later, after ousting General McChrystal, Mr. Obama marched into the Situation Room and cited the teenage triple amputee as he reprimanded advisers for the infighting that had led to the general's forced resignation. "We have a lot of kids on the ground acting like adults and we have a lot of adults in this room acting like kids," he lectured.
The schisms among his team, though, are born in part out of uncertainty about his true commitment. His reticence to talk much publicly about the wars may owe to the political costs of alienating his base as well as the demands of other issues. Senior Pentagon and military officials said they understood that he presided over a troubled economy, but noted that he was not losing 30 American soldiers a month on Wall Street.
The sensitivities about calling attention to the unpopular war in Afghanistan, and particularly America's problematic partner, played out when President Hamid Karzai visited last May. General McChrystal and Ambassador Eikenberry wanted to take Mr. Karzai to Fort Campbell in Kentucky to honor troops leaving for Afghanistan, but the White House objected that it sent the wrong message, as if Americans were fighting for Mr. Karzai. They compromised by having Mr. Gates go as well, but without his Washington press corps.
"From an image point of view, he doesn't seem to embrace it, almost like you have to drag him into doing it," said Peter D. Feaver, a Bush adviser with military contacts. "There's deep uncertainty and perhaps doubt in the military about his commitment to see the wars through to a successful conclusion."
Much of the public too is confused about the president's Afghan strategy, as White House aides and their critics acknowledge. "There have only been a few moments when he's tried to focus the nation's attention on Afghanistan because, quite frankly, it's competing with the other priorities," said Richard Haass, president of the Council on Foreign Relations, who opposes the strategy. "It's probably one of the reasons public support has fallen, because they see the costs but they don't know his thinking about it."
If the flap over General McChrystal underscored the tensions, Mr. Obama's response may have actually helped ease them. "Ironically enough, the McChrystal firing helped a lot because Obama handled it exactly the way most senior military officers would have handled it if they had been in his shoes," said Stephen Biddle, a critic of Mr. Obama's withdrawal deadline at the Council on Foreign Relations.
Perhaps more important was his selection of General Petraeus to take over. The choice brings Mr. Obama full circle. As a senator, he opposed the Iraq troop increase led by General Petraeus, and the two had a wary encounter in Baghdad when Mr. Obama visited as a candidate in 2008. After Mr. Obama came to the White House, General Petraeus no longer had the regular interactions he had with Mr. Bush.
But Mr. Obama came to appreciate General Petraeus's intelligence and dedication. He invited the general to fly on Air Force One with him to West Point for his speech announcing the Afghanistan troop increase. Six months later, after ousting General McChrystal, the president sent his personal aide to find General Petraeus and bring him to the Oval Office for a one-on-one talk. The general accepted the appointment without even a chance to call his wife.
"It's an extraordinary irony," said Mr. Riedel, the former Obama adviser. "He, like Bush before him, has put all his bets down on the table on one guy - and it's the same guy."