General David Petraeus, the outgoing US military commander in Iraq credited for improving security there, has passed control to Lt Gen Raymond Odierno.
The US Defence Secretary, Robert Gates, presided over the ceremony in Baghdad.
Gen Petraeus, who came to the post in February 2007, thanked his troops while Gen Odierno warned that security gains in Iraq were "fragile and reversible."
Gen Petraeus has been promoted to oversee operations in Afghanistan and in the Middle East, including Iraq.
He will take up the post as head of the US Central Command in late October, working from the headquarters in Tampa, Florida.
Gen Petraeus handed the command of the 146,000-strong US force at a ceremony in one of Saddam Hussein's former palaces on the outskirts of the capital.
He thanked his troops and hailed his successor as "the perfect man for the job".
Gen Odierno said he was aware of the tough task ahead, adding that the Iraq people must take charge as "the struggle is theirs to win".
He said: "Iraq is now a different country from the one I had seen first. However, we must realise that these gains are fragile and reversible."
Mr Gates recalled the challenges that Gen Petraeus had faced in his role.
"Darkness had descended on this land," Mr Gates said. "Merchants of chaos were gaining strength. Death was commonplace."
He lauded Gen Petraeus and Gen Odierno for their achievements in Iraq, where Gen Odierno served as deputy US commander in 2007.
"Slowly, but inexorably, the tide began to turn," Mr Gates said. "Our enemies took a fearsome beating they will not soon forget."
Gen Petraeus implemented the "surge" plan, which saw nearly 30,000 US troops deployed to trouble spots in Iraq.
In a major change of strategy, coalition forces also moved out of large bases and into highly populated areas.
Since then, the security situation has improved markedly, with less violence and fewer deaths, and progress on both the political and economic fronts.
General Petraeus's Iraq legacy
The BBC's Mike Sergeant in Baghdad says two other factors were crucial: a ceasefire by the Shia militia and deals with former Sunni insurgents.
But on the eve of Gen Petraeus's departure, a female suicide bomber blew herself up in Diyala province, killing 22 people - a reminder that violence could easily escalate again.
The big challenge for Gen Odierno will be finding ways to stop that sort of violence escalating at a time when the number of US troops are shrinking, our correspondent says.
In a BBC interview before his departure, Gen Petraeus said he would never declare victory in Iraq and that the US still faced a "long struggle" in the country.
When asked if US troops could withdraw from Iraqi cities by the middle of next year, he said that would be "doable".
Last week, Mr Bush announced a cut of 8,000 US troops in Iraq by February - with some 4,500 being sent to Afghanistan.