"The challenge, I think, for general Odierno is: How do we work with the Iraqis to preserve the gains that have already been achieved, expand upon them, even as the numbers of US forces are shrinking?" Gates told reporters.
Iraqi forces have led the majority of security operations in recent months.
"There is no question we will still be engaged"
Robert Gates, the US defence secretary
The US military is also expected to transfer security control in two more provinces this year, putting Iraqi forces in charge of security in 13 out of the country's 18 regions.
Odierno, who served as the commander of US forces in Iraq for 15 months until February, will be promoted to the role of general on Tuesday.
George Bush, the US president, announced last week that at least 8,000 US troops would withdraw from Iraq by next year, leaving approximately 138,000 soldiers in the country.
Many troops who were scheduled to replace those departing from Iraq will now head to Afghanistan, amid rising violence in the country.
US 'still engaged'
Violence in Iraq has declined to its lowest level for four years, but Washington has taken a cautious approach to cuts its troop levels and leave any decision on a major withdrawal to the next US president, who takes office in January.
Gates said it was important for the US and Iraqi forces to maintain pressure on al-Qaeda and Shia rebels.
|US officials have lauded the troop 'surge' for the decline in violence [AFP]
He said that he believed the Iraq war was entering its "endgame", now that the extra US troops have departed and Iraqi forces are taking on more responsibility.
"There is no question we will still be engaged," Gates said.
"But the areas in which we are seriously engaged will, I think, continue to narrow."
Petraeus will take over as the new head of Central Command (Centcom) in late October, a role which involves taking responsibility for US troops from the Horn of Africa to Central Asia.
"General Petraeus has supported the Iraqi army in many ways. His fingerprints [on the army] will be very clear in the future and we will remember him," Abdel Qader Jassim, the Iraqi defence minister, said at a farewell ceremony for Petraeus at the ministry of defence.
Gates told reporters that Petraeus had played an "historic" role in Iraq.
Petraeus has commanded US troops in Iraq since February 2007 and has been credited by the Bush administration with improving Iraqi security through a so-called "surge" of 30,000 troops.
But officials and analysts say the decision by former Sunni Arab rebels to turn against al-Qaeda and a ceasefire imposed by Muqtada al-Sadr, the Iraqi Shia leader, on his Mehdi Army have been the main factors for the decline in violence.
Washington and Baghdad are also close to finalising a security pact that will govern the presence of US forces in Iraq once a UN mandate expires at the end of the year.