WASHINGTON — President Obama took on critics of the nuclear deal between Iran and six world powers in an aggressive speech on Wednesday, saying they were the same people who created the “drumbeat of war” and played on public fears to push the United States into the Iraq war more than a decade ago.

“Let’s not mince words: The choice we face is ultimately between diplomacy and some form of war — maybe not tomorrow, maybe not three months from now, but soon,” Mr. Obama told about 200 people in a speech at American University. “How can we in good conscience justify war before we’ve tested a diplomatic agreement that achieves our objectives?”

Mr. Obama, opening a new, more overtly political phase of his public campaign for the accord, portrayed the coming vote in Congress to approve or reject the deal as the most consequential foreign policy decision for lawmakers since Congress voted in 2003 to authorize the invasion of Iraq. He implored them to “shut out the noise” and back the deal.

Delivered in stark terms that surprised some foreign policy analysts and left no room for questioning whether the agreement is good for American security — “It’s not even close,” Mr. Obama declared at one point — the president’s speech was a striking display of certitude about a diplomatic deal that has split the American public and presented a dilemma for lawmakers, including many in his own party.