Robert Gates is warning that US failure in Iraq would be a "calamity" that would haunt the US for many years to come.
He spoke at his swearing-in ceremony at the Pentagon, where President Bush called him the "right man" to face the multiple challenges that come with wars in Iraq and Afghanistan.
Gates said everyone wants to find a way to bring US troops home. But he said, "We simply cannot afford to fail in the Middle East." He says he intends to travel to Iraq "quite soon" to consult with top American commanders in the field.
Gates took the oath of office from Vice President Dick Cheney. He assumed the job in a private swearing-in ceremony at the White House.
With several dozen uniformed members of the Army, Navy, Air Force and Marines sitting on stage behind him, Gates expressed his thanks for his new assignment. He also paid tribute to the man he is replacing, Donald Rumsfeld, describing him as a dedicated public servant.