President Obama commented on former Defense Secretary Robert Gates’ scathing criticism of the administration in his new memoir, “Duty.”

Real 'Lone Survivor' on Gates' Book: 'Tough' to Fight Without Clear Objective

The president called Gates his "good friend" and said he did an “outstanding job” as his secretary of defense. “As he notes, he and I and the rest of my National Security team came up with a strategy for Afghanistan that was the right strategy, and we are continuing to execute.”

Gates questioned President Obama’s commitment to the Afghanistan and Iraq wars, including the surge. He wrote: “[The president] doesn’t believe in his own strategy, and doesn’t consider the war to be his. For him, it’s all about getting out.”

Report: Hillary Clinton Kept 'Political Hit List' During Pres Campaign

Today at the White House, President Obama went on to say, “What’s important is that we got the policy right, but that this is hard. […] Whenever you’ve got men and women that you are sending into harm’s way after having already made enormous investments of blood and treasure in another country, then part of your job as commander in chief is to sweat details on it.”

The president said he constantly asks himself how to improve the strategy. “The good news is that because of that strategy that we came up with, by the end of this year we will have completed combat operations in Afghanistan.”

Tomorrow, Robert Gates shares insight with Sean Hannity for a cable exclusive interview. Tune in to Hannity at 10p/1a ET, Tuesday on Fox News Channel!