President George Bush used a visit to Israel yesterday to denounce Democratic party offers to negotiate with America's enemies in the Middle East as comparable to appeasement of Hitler.

Although Bush did not name any Democratic politician, the party's presidential contender Barack Obama has offered to open negotiations with the Iranian leader, Mahmoud Ahmadinejad, and the Syrian president, Bashar al-Assad.

Obama and other Democratic leaders expressed outrage at being compared to the Nazis, especially on a visit to Israel. They also condemned Bush for breaking a long-time convention against using foreign visits to score domestic points.

Obama described it as a "false political attack", saying he had never advocated talking to terrorists, while Joe Biden, the Democratic chairman of the Senate foreign relations committee, said: "This is bullshit." The Democratic leader of the House of Representatives, Nancy Pelosi, described Bush's comments as "beneath the dignity of his office".

Speaking during a visit to the Knesset, where he was attending celebrations to mark Israel's 60th anniversary, Bush said it was a foolish delusion to think it was possible to negotiate with extremists and terrorists. "As Nazi tanks crossed into Poland in 1939, an American senator declared: 'Lord, if only I could have talked to Hitler, all of this might have been avoided,'" Bush said.

He added: "We have an obligation to call this what it is - the false comfort of appeasement, which has been repeatedly discredited by history."

The president did not say whether he was referring to Obama's offer to meet Ahmadinejad or to former president Jimmy Carter's meeting with Hamas. The White House press spokeswoman, Dana Perino, denied that the comments were directed at Obama.

Obama's campaign team accused Bush of abusing his office to help the Republican White House candidate, John McCain.

McCain, in a conference call with bloggers, used similarly emotional language as Bush and repeatedly accused Obama of being naive in his willingness to negotiate with the Iranian leadership. "If Senator Obama wants to sit down across the table from a country that calls Israel a stinking corpse and [whose president] comes to New York and says he wants to wipe Israel off the map, what is it that he wants to talk about with them?" McCain asked.

Earlier, McCain bowed to anti-war sentiment by setting 2013 as the date for withdrawal of US forces from Iraq, in an attempt to boost his chances of winning the White House. He said he expected the war to be over by that date. The comment marked a U-turn for McCain, who had based his run for the White House on his willingness to keep US forces in Iraq for up to 100 years.

McCain's retreat came despite having berated his Democratic rivals for the last 12 months for demanding a firm withdrawal date from Iraq, saying it would lead to chaos and genocide. But his strong support for keeping US troops in Iraq has proved costly for his campaign, with feelings against the war running as high as 63% in a USA Today-Gallup poll last month.

Obama has promised to have most troops out of Iraq by December 2009. McCain rolled out his new vision for Iraq in a speech in the swing state of Ohio. He anticipated that by January 2013 "America has welcomed home most of the servicemen and women who have sacrificed terribly so that America might be secure.

"The Iraq war has been won. Iraq is a functioning democracy, although still suffering from the lingering effects of decades of tyranny and centuries of sectarian tension. Violence still occurs, but it is spasmodic and much reduced." The address was part of a concerted effort by the presumptive Republican nominee to win over independent and moderate Democratic voters by distancing himself from Bush's unpopular policies.

Republican fears that they could lose both the White House and Congress in the November election increased on Tuesday when they lost a previously safe congressional seat in Mississippi. Frank Luntz, a Republican strategist who has warned that the party faces disaster in November, said: "John McCain will not be elected on Republican votes alone. He is going to have to defeat Obama with independent voters as well, which is why he is beginning to talk about a date certain for withdrawal."

Judith Kipper, a Middle East specialist at the Washington-based Institute of World Affairs, said that McCain's reference to 100 years in Iraq was a "phrase that is going to haunt him throughout the campaign", and that his speech yesterday was designed to provide a position that was more acceptable to the electorate.