Besieged at home over mounting US casualties in the conflict in Iraq, Mr Bush used the ceremony in Budapest to spread the word that perseverance in the name of freedom pays in the end.
Mr Bush on a lightning European tour, tried to shore up the United States' faltering international image, at a time when Washington stands accused of violating human rights in its fight against the world threat of terrorism.
The United States had failed in 1956 to come to the aid of Hungary's 12-day uprising against communist tyranny but Mr Bush said in a speech to Hungarians on a hill over the Danube River:
"America honours your courage. We have learned from your example and we resolve that when people stand up for their freedom, America will stand with them."
Soviet troops "crushed the Hungarian uprising but not the Hungarian people's thirst for freedom," Mr Bush told a crowd of 400, including the country's president and prime minister, against a picture-perfect view of Budapest, dominated by the large dome of parliament.
Democratic ideals
Mr Bush said the new Iraqi government "is committed to the democratic ideals that also inspired Hungarian patriots in 1956 and 1989," when the communist regime fell in Hungary.
"Iraq's young democracy still faces determined enemies, people who will use violence and brutality to stop the march of freedom," he said.
"Defeating these enemies will require sacrifice and continued patience, the kind of patience the good people of Hungary displayed after 1956. We will help them rebuild a country destroyed by a tyrant...
"We will continue to help the Iraqi government establish free institutions" so that it can take its "rightful place alongside America and Hungary as beacons of liberty in our world," Mr Bush said.
He said that new Iraqi Prime Minister Nuri Maliki "is committed to the democratic ideals that also inspired Hungarian patriots in 1956 and 1989."
"The lesson of the Hungarian experience is clear. Liberty can be delayed but it cannot be denied," Mr Bush said.
Hungary is a member of the "New Europe" of former communist states which have often been strong supporters of US policy.
The Hungarian government has sent troops to support the US war in Iraq and peacekeeping operations in Afghanistan.
Welcome break
Hungary was a welcome stop after an EU-US summit in Vienna at which Mr Bush had to defend the United States' credentials as a supporter of human rights and democracy.
Mr Bush left for Washington on Thursday but travels to Europe again on July 15 for a Group of Eight summit in Saint Petersburg that could also be a forum for a discussion of democracy, with Washington criticizing Russia for dragging on reforms.
In Vienna, Mr Bush addressed European concerns about Washington holding inmates without charges at the Guantanamo prison camp for terror suspects, saying he would like to close the site but that a way must first be found to send prisoners home or put them on trial.
But Mr Bush also told a press conference in the Austrian capital that "it was absurd for people to think that we're more dangerous than Iran."
In Budapest, Hungarian President Laszlo Solyom however re-stated European worries when he told reporters after meeting Mr Bush earlier Thursday that "this fight against terrorism can be successful only if every step and measure taken are in line with international law."
Mr Solyom also said Mr Bush's visit "underlines the importance of 1956, how important it was from the point of view of global history."
On October 2, 1956, the eyes of the world turned to Hungary where a spontaneous insurrection challenged Stalinist rule.
Hungary is now a member of both the European Union and NATO and one of the former Soviet bloc's most successful market economies.
Mr Bush was visiting four months ahead of the official celebration of the Hungarian uprising, as his schedule does not allow for a visit in October. He laid a wreath to the victims of the uprising.
A total of 2,500 people died in fighting and hundreds of thousands left the country, many for the United States.
