WATERTOWN, S.D. - Sen. Barack Obama responded sharply yesterday to recent attacks on his foreign policy, linking President Bush and Sen John McCain as partners in "the failed policies" of the last seven years and criticizing them for "hypocrisy, fear-peddling, fear-mongering."

Confronting a major challenge to his foreign policy and world view, Obama attempted to turn the tables on his Republican critics, saying they were guilty of "bluster" and "dishonest, divisive" tactics. He also cited a litany of what he called foreign-policy blunders by the Bush administration and accused McCain, the presumed Republican presidential nominee, of "doubling down" on them.

Obama's remarks came a day after Bush, addressing the Israeli parliament, had spoken of what he called a tendency toward "appeasement" in some quarters of the West, similar to that shown to the Nazis by some before the invasion of Poland. Bush also said he rejected negotiations with "terrorists and radicals," implying that Democrats favored such a position. Obama said he found the remarks "offensive."

"George Bush and John McCain have a lot to answer for," Obama said at a town-hall meeting here, listing the war in Iraq, the strengthening of Iran and extremist groups such as Hamas and Hezbollah, the inability to capture Osama bin Laden and stalled diplomacy in other parts of the Middle East as among their chief failings.

He added: "If George Bush and John McCain want to have a debate about protecting the United States of America, that is a debate I am happy to have any time, any place."

McCain's campaign answered quickly and sharply. spokesman Tucker Bounds called the remarks a "hysterical diatribe in response to a speech in which his name wasn't even mentioned."

Obama's defiant tone and disdainful characterization of the Bush record appeared to be a signal to critics that he will push back against any attempts to define him or his record as weak on terrorism or accommodating to foreign foes - a strategy Republicans used successfully against Sen. John Kerry in 2004. The episode also signaled that the campaigns are pivoting swiftly toward the general election, with both sides already in full-attack mode.

Consistently throughout his comments about foreign policy, Obama yoked Bush and McCain together as a single entity, mentioning their names in the same sentence 10 times in barely 10 minutes. He also portrayed them as being not only inflexible, but also "naive and irresponsible" - the very characteristics they ascribe to him.

McCain, speaking to the National Rifle Association in Louisville, Ky., said he welcomed a debate with Obama over national security and threw the "naive" description back at him. "It would be a wonderful thing if we lived in a world where we don't have enemies," McCain said. "But that is not the world we live in, and until Sen. Obama understands that reality, the American people have every reason to doubt whether he has the strength, judgment and determination to keep us safe."

McCain had endorsed Bush's remarks, saying: "The president is exactly right." He said Obama "needs to explain why he is willing to sit down and talk" with Iranian President Mahmoud Ahmadinejad.

For nearly a month, Republicans have been stepping up criticism of Obama's foreign-policy perspective, highlighting complimentary comments made about him by a Hamas official in April, and Obama's own statements that he is willing to meet with leaders of so-called rogue states such as Iran, Syria, North Korea and Venezuela "without preconditions."

In responding yesterday, Obama attempted to deflect and counter those criticisms by articulating his own view of foreign relations, one in which military might is accompanied by diplomatic engagement with all countries, including U.S. enemies. The most specific example he offered was a dramatically changed policy toward Iran, one that would be equal parts carrot and stick.

"It's time to present Iran with a clear choice," Obama said. "If it abandons its nuclear program, support for terror and threats to Israel, then Iran can rejoin the community of nations. If not, Iran will face deeper isolation and steeper sanctions."

McCain responded by saying: "I have some news for Sen. Obama: Talking, not even with soaring rhetoric, in unconditional meetings with the man who calls Israel 'a stinking corpse' and arms terrorists who kill Americans will not convince Iran to give up its nuclear program. It is reckless to suggest that unconditional meetings will advance our interests."