President George W Bush has warned a US withdrawal from Iraq could trigger the kind of upheaval seen in South East Asia after US forces quit Vietnam.
"The price of America's withdrawal was paid by millions of innocent citizens," he told war veterans in Missouri.
Mr Bush said the Vietnam War had taught the need for US patience over Iraq.
His speech comes amid an apparent rift with Iraqi Prime Minister Nouri Maliki, but Mr Bush said Mr Maliki was a "good man with a difficult job".
Hours earlier, Mr Maliki called recent US criticism of his work "discourteous".
The White House was swift to respond, saying in a statement that Mr Bush still believes that Mr Maliki is the right person to lead Iraq.
THE VIETNAM WAR
Ran from 1959-1975
Democratic Republic of Vietnam (North Vietnam) defeated US-backed Republic of Vietnam (South Vietnam)
Estimated four million Vietnamese civilians killed
1.1 million communist fighters killed
200-250,000 South Vietnamese troops killed
58,200 US troops killed or missing in action
Mr Bush began his speech at the annual convention for the Veterans of Foreign Wars (VFW) group, in Kansas City, by flagging up US successes in staying the distance in other conflicts - particularly in turning Japan from an enemy into a key ally.
"The ideals and interests that led America to help the Japanese turn defeat into democracy are the same that lead us to remain engaged in Afghanistan and Iraq," Mr Bush said.
"The defence strategy that refused to hand the South Koreans over to a totalitarian neighbour helped raise up an Asian Tiger that is a model for developing countries across the world, including the Middle East."
Legacy of defeat
Mr Bush compared current calls for withdrawal from Iraq with what happened at the end of the Vietnam War in 1975.
"Many argued that if we pulled out, there would be no consequences for the Vietnamese people," Mr Bush said. "The world would learn just how costly these misimpressions would be.
"Three decades later, there is a legitimate debate about how we got into the Vietnam War and how we left.
Mr Bush spoke of the massacres under Cambodia's Khmer Rouge
"Whatever your position in that debate, one unmistakable legacy of Vietnam is that the price of America's withdrawal was paid by millions of innocent citizens," Mr Bush said, mentioning reprisals against US allies in Vietnam, the displacement of Vietnamese refugees and the massacres in Cambodia under Pol Pot's Khmer Rouge.
He warned that in Iraq there was the added danger that a US withdrawal would signal victory for al-Qaeda, emboldening its leaders and drawing in new recruits.
BBC world affairs correspondent Nick Childs says Mr Bush's speech will fuel the controversy over whether he is drawing the right or wrong lessons from history.
Opinion polls suggest that many Americans clearly do not see the stakes or the struggle in the same way, our correspondent says.
Mr Bush is pressing home these broad themes even more forcefully than before because he faces a very specific short-term political problem, with less than 18 months left as president.
Whether his successor will see things in the same ideological and historic terms is, at the very least, open to question, our correspondent adds.
In other news in Iraq:
- Fourteen US soldiers were killed when a Black Hawk helicopter in which they were travelling crashed in northern Iraq. The military said a mechanical fault was to blame.
- At least 24 people were killed and 50 injured when a suicide bomber rammed a fuel tanker into a police station in the northern oil city of Baiji.
- The deputy US commander in Iraq told the BBC that the US had recruited 20,000 civilian volunteers to act as local police in sensitive areas of the country.
'Seeking friends elsewhere'
Mr Bush's speech came as Mr Maliki was moved to defend his administration in the face of US criticism.
"No-one has the right to place timetables" on the Iraqi government's performance Mr Maliki said, blaming the US presidential election campaign for many of the negative comments being made.
Speaking at the end of a visit to Syria, he said Iraq would pay no attention and could "find friends elsewhere".
The Bush administration has called on Mr Maliki's cabinet to perform
After Mr Bush's latest address, in which he praised the Iraqi prime minister, a spokesman for Mr Maliki said they welcomed the president's comments:
"His speech yesterday was a bit ambiguous and confusing, but he clarified things in his speech today," the spokesman told the BBC.
"Mr Maliki said in Syria that he agrees with President Bush that the people of Iraq have the final say in changing their government. So our reaction is positive."
On Tuesday, Mr Bush had appeared to distance himself from Mr Maliki's government for the first time.
Mr Bush said the people of Iraq had made a great step towards reconciliation. However he added that there was "a certain level of frustration with the leadership" of Mr Maliki and that his government now had to perform.