As Republicans on the campaign trail ramped up their support for Israel in a possible military strike on Iran, President Obama used a speech before a pro-Israel lobbying group on Sunday to warn against the "loose talk of war" that could serve to speed Iran toward a nuclear weapon.

In a forceful address to the group, the influential American Israel Public Affairs Committee, Obama declared that he would not tolerate a nuclear-armed Iran and would act - with military force, if necessary - to prevent that from happening.

But he made it clear that he did not believe that a strike on Iran would serve the interests of either the United States or Israel. And he chided his Republican critics for, as he described it, putting politics ahead of American national security interests.

"Already, there is too much loose talk of war," Obama said. "Over the last few weeks such talk has only benefited the Iranian government by driving up the price of oil, which they depend on to fund their nuclear program.

"For the sake of Israel's security, America's security and the peace and security of the world, now is not the time for bluster."

And as he often does, Obama quoted President Theodore Roosevelt: "Speak softly. Carry a big stick."

For Obama, the speech, before some of Israel's loudest and staunchest supporters in the United States, was a political high-wire act, an effort to demonstrate his commitment to Israel's security without signaling American support for a pre-emptive strike against Iran. And it was an effort to confront the Republican presidential candidates who have turned the Iranian nuclear issue into the top item in their litmus test for demonstrating support for Israel.

Even as Obama was giving his keynote address to the Aipac conference, Newt Gingrich, the former House speaker, was questioning the president's Iran strategy on the Sunday talk shows. "We're being played for fools," Gingrich said on "State of the Union" on CNN. "Israel is such a small country; it is so compact that two or three nuclear weapons would be equivalent to a second Holocaust."

After Obama's speech, Mitt Romney, the former Massachusetts governor, said at a campaign stop near Atlanta, "If Barack Obama gets re-elected, Iran will have a nuclear weapon, and the world will change if that's the case." Gingrich, Romney and Rick Santorum are also scheduled to address Aipac this week.

Obama, who has often lamented the United States' invasion of Iraq in 2003, made reference to European and American intelligence assessments that have found no evidence that Iran has decided to pursue a nuclear weapon. Recent assessments by American spy agencies have also reaffirmed intelligence findings in 2007 and 2010 that concluded that Iran had abandoned its nuclear weapons program.

"The United States and Israel both assess that Iran does not yet have a nuclear weapon," Obama said. He also promised vigilance to make sure that Iran's civilian nuclear agenda did not turn into a weapons program.

Obama has nonetheless been dogged by Republican criticism that he has not backed Israel strongly enough, with Iran's nuclear ambitions now front and center in that debate.

In many ways, Obama's speech was meant to demonstrate that he would use military options as a last resort.

"I do not have a policy of containment," Obama said, to applause from the huge crowd at the Washington convention center. "I have a policy to prevent Iran from obtaining a nuclear weapon. And as I've made clear time and again during the course of my presidency, I will not hesitate to use force when it is necessary to defend the United States and its interests."

At the same time, he seemed to indicate that he would not be pushed into military action.

"As president and commander in chief, I have a deeply held preference for peace over war," Obama said. "I have sent men and women into harm's way. I have seen the consequences of those decisions in the eyes of those I meet who have come back gravely wounded, and the absence of those who don't make it home." He called the image of wounded American soldiers "the most searing of my presidency."

"For this reason," he said, "as part of my solemn obligation to the American people, I only use force when the time and circumstances demand it. And I know that Israeli leaders also know all too well the costs and consequences of war, even as they recognize their obligation to defend their country."