PITTSBURGH — President Obama said Tuesday that opponents of the nuclear deal with Iran were behaving like those who pushed for war with Iraq more than a decade ago, and said the United States should choose diplomacy instead of another rush to armed conflict.

In remarks to members of the Veterans of Foreign Wars, Mr. Obama said the criticism of the Iran agreement offered “echoes of some of the same mind-set and policies that failed us in the past,” and was being put forward by “the same folks who were so quick to go to war in Iraq.”

The president did not mention President George W. Bush or Vice President Dick Cheney by name in his remarks, but the implication was clear. As he seeks to persuade members of Congress not to reject the Iran deal, Mr. Obama urged what he called “a smarter, more responsible way to protect our national security.”