Lt Gen Ray Odierno and Gen David Petraeus at the ceremony in Baghdad
The new US military commander in Iraq, Lt Gen Ray Odierno, has said that recent security gains there are "fragile and reversible".
He was speaking in Baghdad at a ceremony to replace Gen David Petraeus.
Gen Petraeus, who implemented the "surge" of nearly 30,000 extra US troops in Iraq, is widely credited with driving down levels of violence there.
He 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 its 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 Iraqi 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."
Presiding over the ceremony, the US Secretary of Defence, Robert Gates, said the two generals had formed an "incredible team" while implementing the "surge" plan in 2007.
He said that Gen Odierno, who served as deputy commander in Iraq for 15 months, knew "we are at a pivotal moment where progress remains fragile and caution should be the order of the day".
HAVE YOUR SAY
All the insurgents have to do is wait for the coalition to hand power back to Iraq and withdraw its forces
Mr Gates recalled the challenges faced by Gen Petraeus, saying: "Darkness had descended on this land. Merchants of chaos were gaining strength. Death was commonplace.
"Slowly, but inexorably, the tide began to turn. Our enemies took a fearsome beating they will not soon forget," Mr Gates said.
Alongside the "surge", Gen Petraeus oversaw a major change of strategy, with coalition forces moving 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.
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.
Gen Petraeus on US military strategy in Iraq
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".
Mr Bush has announced a cut of 8,000 US troops in Iraq by February - with some 4,500 being sent to Afghanistan.