Bush ducked both shoes as they whizzed past his head and landed with a thud against the wall behind him.
"It was a size 10," Bush joked later.
The U.S. president visited the Iraqi capital just 37 days before he hands the war off to his successor, Barack Obama, who has pledged to end it. The president wanted to highlight a drop in violence in a nation still riven by ethnic strife and to celebrate a recent U.S.-Iraq security agreement, which calls for U.S. troops to withdraw from Iraq by the end of 2011.
"The war is not over," Bush said, adding that "it is decisively on it's way to being won."
Bush then flew to Bagram Air Base in Afghanistan for a rally with U.S. and foreign troops.
In many ways, the unannounced trip was a victory lap without a clear victory. Nearly 150,000 U.S. troops remain in Iraq fighting a war that is intensely disliked across the globe. More than 4,209 members of the U.S. military have died in the conflict, which has cost U.S. taxpayers $576 billion since it began five years and nine months ago.
There are about 31,000 U.S. troops in Afghanistan now, and commanders have called for up to 20,000 more. The need is especially great in southern Afghanistan, long a stronghold of the Taliban and the place where recent spikes in violence have proven the insurgency capable of reasserting itself.
Polls show most Americans believe the U.S. erred in invading Iraq in 2003. Bush ordered the nation into war against Saddam Hussein's Iraq while citing intelligence claiming the Mideast nation harbored weapons of mass destruction. The weapons were never found, the intelligence was discredited, Bush's credibility with U.S. voters plummeted and Saddam was captured and executed.
"There is still more work to be done," Bush said after his meeting with Iraqi Prime Minister Nouri al-Maliki.
It was at that point the journalist stood up and threw a shoe from about 20 feet away. Bush ducked, and it narrowly missed his head. The second shoe came quickly, and Bush ducked again while several Iraqis grabbed the man and dragged him to the floor.
In Iraqi culture, throwing shoes at someone is a sign of contempt. Iraqis whacked a statue of Saddam with their shoes after U.S. marines toppled it to the ground following the 2003 invasion. White House press secretary Dana Perino suffered an eye injury in the news conference melee; NBC News reported she was hit in the face with a microphone. Bush brushed off the incident, comparing it to political protests at home.
"So what if a guy threw his shoe at me?" he said.
Al-Maliki, who spoke before the incident, praised postwar progress: "Today, Iraq is moving forward in every field."
After the news conference, the president took a 15-minute helicopter ride through dark skies over Baghdad to Camp Victory. Telling hundreds of troops he was "heading into retirement," Bush blamed Saddam for the 2003 invasion and said, "America is safer and more secure" than it was before the war.
Air Force One, the president's distinctive powder blue-and-white jetliner, landed at Baghdad International Airport in the afternoon local time after a secretive Saturday night departure from Washington. In a sign of security gains in this war zone, Bush received a formal arrival ceremony - a flourish absent in his three earlier trips.
Bush soon began a rapid-fire series of meetings with top Iraqi leaders.
He met first with Iraqi President Jalal Talabani and the country's two vice presidents, Tariq al-Hashemi and Adel Abdul-Mahdi, at the ornate, marble-floored Salam Palace along the shores of the Tigris River.
Later, Bush's motorcade pulled out the heavily fortified Green Zone and crossed over the Tigris so he could meet al-Maliki at the prime minister's palace. A huge orange moon hung low over the horizon as Bush's was ferried quickly through the city.
The two leaders signed ceremonial copy of the security agreement.
The Bush administration and even White House critics credit last year's military buildup with the security gains in Iraq. Last month, attacks fell to the lowest monthly level since the war began in 2003.
Still, it's unclear what will happen when the U.S. troops leave. While violence has slowed in Iraq, attacks continue, especially in the north. At least 55 people were killed Thursday in a suicide bombing in a restaurant near Kirkuk.
It was Bush's last trip to the war zone before Obama takes office Jan. 20. Obama won an election largely viewed as a referendum on Bush, who has endured low approval ratings because of the war and more recently, the U.S. recession.
Obama, a Democrat, has promised he will bring all U.S. combat troops back home from Iraq a little over a year into his term, as long as commanders agree a withdrawal would not endanger American personnel or Iraq's security. Obama has said the drawdown in Iraq would allow him to shift troops and bolster the U.S. presence in Afghanistan.
The new U.S.-Iraqi security pact, calls for all American troops to be withdrawn by the end of 2011, in two stages. The first stage begins next year, when U.S. troops pull back from Baghdad and other Iraqi cities by the end of June. Gen. Raymond Odierno, the top U.S. commander in Iraq, said Saturday that even after that summer deadline, some U.S. troops will remain in Iraqi cities.
Journalists and staff who made the 10½-hour trip to Iraq with the president agreed to tell almost no one about the plans, and the White House released false schedules detailing activities planned for Bush in Washington on Sunday.