The presumed Democratic nominee, who was in Washington to speak to the National Association of Latino Elected and Appointed Officials, slipped into the facility shortly after 9 a.m. without stopping to speak to the small group of reporters who follow him. The visit wasn't on his public schedule.
Obama has criticized the Bush administration for its treatment of veterans returning from the Iraq and Afghanistan wars, and has suggested Republican rival John McCain would continue Bush policies if elected.
The administration was roundly criticized last year after it was revealed that veterans at Walter Reed were housed in rundown accommodations and suffered neglectful care.
Obama has said the country has failed its veterans by allowing such "second-rate conditions," by not giving troops enough time at home and not doing enough to support military families.
In a speech at a rally with his former Democratic opponent Hillary Rodham Clinton on Friday, Obama said voters have a choice about whether to continue spending billions of dollars every month in Iraq, and leave troops there for 20 years, 50 years or 100 years - a line that elicited boos from the crowd.
"It is time to rebuild our military and take care of our veterans," he said.
On veterans issues, McCain is seen by his supporters as having the advantage of military experience - the Arizona senator was a Navy pilot, and spent nearly six years as a Vietnam prisoner of war after he was shot down.
Obama, who serves on the Senate Committee on Veterans' Affairs, often notes that his grandfather served in World War II.
He criticizes McCain for opposing an expansion of the GI bill to guarantee full college scholarships for those who serve in the military for three years. McCain and Pentagon officials say they oppose the bill because they fear it would encourage people to leave after only one enlistment during a war.
Obama To Visit Europe, Mideast This Summer
Obama plans to visit the Middle East and Europe this summer, taking time off from campaigning in the United States in an effort to boost his foreign policy credentials.
Obama's campaign told The Associated Press the likely nominee will travel to Jordan, Israel, Germany, France and the United Kingdom. The Illinois senator also has said he intends to visit Iraq and Afghanistan this summer; his campaign would not say whether those stops would be part of the trip to the Mideast and Europe.
"This trip will be an important opportunity for me to assess the situation in countries that are critical to American national security, and to consult with some of our closest friends and allies about the common challenges we face," Obama said in a statement.
"This will be an important opportunity to have an exchange of views with leaders in these countries about these and other issues that are critical to American national security and global security in the 21st century."
The campaign also would not disclose the dates of any of the plans in an attempt to protect Obama's security. Obama's campaign manager said this past week that Iraq and Afghanistan would be part of an official congressional trip. The other stops are part of a campaign-funded visit.
Obama foreign policy adviser Denis McDonough said the senator wants to consult with leaders of some important U.S. allies about common challenges, including terrorism, nuclear proliferation, climate change, Iraq, Afghanistan and Iran.
"He obviously wants to consult with the leaders of those countries but also find an opportunity to speak to the people of those countries about our shared values and goals," McDonough said in an interview Saturday.
An Associated Press-Yahoo News poll taken this month found that 61 percent of those surveyed see McCain as a good military leader, compared with 27 percent for Obama. But they see Obama as more likely to improve America's standing in the world, 43 percent to 33 percent who said the same about McCain.