President George Bush, on his first visit to a country where America lost a two-decade-long fight against communism, said Friday the Vietnam War's lesson for today's confounding Iraq conflict is that freedom takes time to trump hatred.

Embracing a former enemy that remains communist but is allowing capitalism to surge, Bush opened a four-day stay here that was fueling an already raging debate over his war policy. Democrats who won control of Congress say last week's elections validate their call for U.S. troops to start coming home soon, while Bush argues — as he did again Friday — for patience with a mission he says can't be ended until Iraq can remain stable on its own.

A baby boomer who came of age during the turbulent Vietnam era and spent the war stateside as a member of the Texas Air National Guard, the president called himself amazed by the sights of the onetime war capital. He pronounced it hopeful that the United States and Vietnam have reconciled differences after a war that ended 31 years ago when the Washington-backed regime in Saigon fell.

"My first reaction is history has a long march to it, and societies change and relationships can constantly be altered to the good," Bush said after speeding past signs of both poverty and the commerce produced by Asia's fastest-growing economy.

The president said there was much to be learned from the divisive Vietnam War — the longest conflict in U.S. history — as his administration contemplates new strategies for the increasingly difficult war in Iraq, now in its fourth year. But his critics see parallels with Vietnam — a determined insurgency and a death toll that has drained public support — that spell danger for dragging out U.S. involvement in Iraq.

"It's just going to take a long period of time for the ideology that is hopeful — and that is an ideology of freedom — to overcome an ideology of hate," Bush said after having lunch at his lakeside hotel with Australian Prime Minister John Howard, one of America's strongest allies in Iraq, Vietnam and other conflicts.

"We'll succeed," Bush added, "unless we quit."

In a day of meetings with Vietnamese leaders, the Vietnam-Iraq comparisons gave way to a focus on areas of cooperation. Those include continuing military-to-military links, work on AIDS and bird flu, trade, and cooperation on information about more than 1,300 U.S. military personnel still unaccounted for from the Vietnam War.

Bush was visiting the U.S. military's Joint POW/MIA Accounting Command here on Saturday.

He met in succession with Vietnamese President Nguyen Minh Triet at the bright orange presidential palace, with Prime Minister Nguyen Tan Dung next door, and with the country's most powerful leader, Communist Party chief Nong Duc Manh, at the ruling party headquarters across the street. Each time, he and his hosts sat under a large bronze bust of Ho Chi Minh, the victorious North's revolutionary communist leader.

Nong said the president had "opened a new page in the relationship."

In the evening, Bush was being feted at a state banquet.

The president's welcome by the public was much less enthusiastic than the rock-star treatment afforded President Clinton when he came in 2000. Happy crowds thronged Clinton, who normalized relations with Vietnam.

But Bush encountered a country where many with long memories deeply disapprove of the U.S. invasion of Iraq — even as they yearn for continued economic progress to stamp out still-rampant poverty.

With all traffic halted, many Hanoi residents gaped at his long motorcade from their motorbikes. Other clusters of onlookers gathered before storefronts, a few waving but most merely looking on impassively.

Huynh Tuyet, 71, a North Vietnamese veteran who had his hand blown off fighting the Americans, recalled his own lesson.

"Even though the Americans were more powerful with all their massive weapons, the main factor in war is the people," he said. "The Vietnamese people were very determined. We would not give up. That's why we won."

Vietnamese officials eager for their country to take its turn in the global spotlight expressed disappointment that the president arrived without his expected gift — congressional approval of a new pact normalizing trade relations with Vietnam.

Surprising the White House, Congress failed to pass the bill this week as expected, leaving U.S. officials trying to explain to the Vietnamese that it would be sure to go through next month.

The visit was a delicate balancing act for Bush. He was trying to improve relations with a crucial Asian economic force and to urge Vietnam to make further steps toward political, economic and social reforms — even as his mere presence conferred special status on a communist government.

Inside the sprawling Communist Party headquarters, the president gently pressed his hosts on the need for greater political and religious freedoms. He was reinforcing this point Sunday with a visit to a Hanoi church, similar to a stop he made last year on a trip to communist China.

After remaining in Hanoi for a massive summit of 21 Pacific Rim leaders, Bush was traveling on Monday to Ho Chi Minh City, formerly Saigon and the country's economic heart, where he was showcasing Vietnam's booming economy with a visit to its stock exchange and discussions with business leaders. He was also going to a medical institute there that focuses on bird flu and AIDS research and taking in a cultural performance at a local museum.

On the sidelines of the summit, Bush was drawing on his powers of personal diplomacy in one-on-one meetings with Russia's Vladimir Putin, China's Hu Jintao, Japan's Shinzo Abe and South Korea's Roh Moo-hyun.