Barack Obama insisted Monday he had faith in his Afghanistan strategy, after a book by former his defense secretary claimed the president had soured on his troop surge and its commanders.

Facing journalists in the Oval Office, Obama also hailed Robert Gates as an "outstanding" Pentagon chief.

Obama defended both the troop surge strategy that was unveiled in December 2009, and the naming of an end date for NATO combat operations in Afghanistan at the end of this year as "the right strategy" and said: "We are continuing to execute it."

"What is important is we got the policy right. But this is hard and it always has been," Obama said.

"Just as I have continued to have faith in our mission, more importantly I have had unwavering confidence in our troops," Obama said.

The president added that the job is "not yet done" in Afghanistan, but declined to say whether he was irked that Gates had released the book to much controversy during his presidency and while the war continues.