"As I said throughout the campaign, I will be giving Secretary Gates and our military a new mission as soon as I take office -- responsibly ending the war in Iraq through a successful transition to Iraqi control," Obama said during a news conference in Chicago during which he introduced his national security team nominees.
Obama also pledged to make the necessary investments to "strengthen our military and increase our ground forces to defeat" modern-day security threats.
"We will ensure that we have the strategy and resources to succeed against al-Qaida and the Taliban," Obama said. "As Bob said not too long ago, Afghanistan is where the war on terror began and it is where it must end."
Gates said he was honored to have been asked to remain as Pentagon chief after Obama takes office in January.
"Mindful that we are engaged in two wars and face other serious challenges at home and around the world, and with a profound sense of personal responsibility to and for our men and women in uniform and their families, I must do my duty -- as they do theirs," Gates said. "How could I do otherwise?"
Obama said Gates was someone who is "doing everything he can every single day to make sure that our troops are properly equipped and trained and organized in order to succeed at their missions and that their families are cared for. So I have complete confidence in Secretary Gates being able to carry out his tasks."