Thousands of troops based here have served in Iraq, others are still there and thousands more will be heading back, reports CBS News White House Correspondent Mark Knoller.
Mr. Bush thanked them all, but said it isn't time to start bringing U.S. forces home yet.
"Iraqis want to be led by their own countrymen," Mr. Bush said. "We'll help them achieve that objective. And then our troops can come home with the honor they deserve."
"In the last two years you have accomplished much, but your work isn't over," he said. Terrorists "will remain under constant pressure from our armed forces."
Base officials said 25,000 soldiers came to hear the commander in chief. As the Marine One helicopter carrying the president came in for a landing, the pilot circled the enormous crowd crammed shoulder-to-shoulder on a base parade field, waving hand-held American flags.
"Whether you are coming or going, you're making an enormous difference for the security of our nation and for the peace of our world," Mr. Bush told them. "I want to thank you for extending freedom to millions, and I want to thank you for making America proud."
The crowd remained somber and silent for much of the speech as Mr. Bush talked about the plight of Iraqis and soldiers who have aided them. They let out occasional whoops as the president mentioned various base contingents who have contributed.
"If we can start to change the most powerful country in the Middle East, the others will follow," he said. "Americans 20 years down the road won't have to deal with a day like Sept. 11, 2001."
Mr. Bush noted that on April 9, 2003 — two years ago last Saturday — a statue of Saddam Hussein that stood in Baghdad was pulled from its pedestal to the ground.
"The toppling of Saddam Hussein's statue in Baghdad will be recorded along with the fall of the Berlin Wall as one of the great moments in history," he said.
Mr. Bush wrapped up a week of travel with the pep talk and lunch with soldiers stationed at Fort Hood, the largest active-duty armored post in the military. The president made his way through the mess hall serving line, piling a plate with fried chicken, collard greens and macaroni and cheese.
He was meeting privately with the families of about 30 soldiers who have been killed before leaving the base. Ft. Hood has lost 146 soldiers in Iraq, according to Fort Hood spokesman Lt. Col. Dan Baggio.
Soldiers and residents in Iraq still face daily violence, such as Monday's truck explosion near a U.S. convoy and a suicide bombing attack at a Marine outpost. Monday's abduction of a U.S. contractor also heightened fears among foreigners working in Iraq.
Mr. Bush also visited Fort Hood on Easter Sunday, when he worshipped at a base church and said he prayed for peace. His return to the base, just a short helicopter ride from his Crawford ranch, was originally scheduled for Friday but was delayed so he could attend Pope John Paul II's funeral in Rome.
The president left Washington for Rome on Wednesday and after the pope's funeral flew directly to Texas for a weekend at his ranch. Israeli Prime Minister Ariel Sharon visited Monday.
Mr. Bush was returning to the White House later Tuesday.