WASHINGTON — 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, Mr. 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,” Mr. 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.