Troop promises
Mr Bush's visit, unannounced in advance and conducted under tight security, follows the approval last month of a security pact between Washington and Baghdad that calls for US troops to be withdrawn from Iraq by the end of 2011.
US troops are first to withdraw from Iraqi cities, including Baghdad, by June next year.
Defence Secretary Gates said on Saturday that "the process of the drawdown" had begun.
The end in sight for US troops in Iraq?
"We are, I believe, in terms of the American commitment, in the endgame here in Iraq," he told US troops at an airbase near Baghdad.
Mr Gates has been picked to stay on as defence secretary by President-elect Barack Obama.
President Bush leaves the White House in less than six weeks. He said in a recent interview with ABC News that the biggest regret of his presidency was the false intelligence that Iraq had weapons of mass destruction.
Finding these was one of the key justifications for the invasion. None were ever found.
Mr Obama has promised to bring home US combat troops from Iraq in a little over a year from when he takes office in January.
More than 4,200 US troops and tens of thousands of Iraqi civilians and security personnel have been killed since the invasion in 2003.
There are currently about 149,000 US soldiers in Iraq, down from last year's peak of 170,000 after extra troops were poured in to deal with a worsening security situation.
As Mr Bush arrived in Baghdad, Gen David Petraeus, the head of the US Central Command, which includes Iraq, said attacks in the country had dropped from 180 a day in June 2007 to 10 a day now.
In a sign of modest security gains in Iraq, Mr Bush was welcomed with a formal arrival ceremony - a flourish that was not part of his previous three visits.
He arrived in the country on Air Force One, which landed at Baghdad International Airport in the afternoon, after a secretive Saturday night departure from Washington on an 11-hour flight.