President Obama on Monday defended his nuclear deal with Iran in the face of congressional and international criticism, warning that “tough talk and bluster” are not enough to protect America's security.

In an address in San Francisco, where he spoke primarily on immigration reform, Obama touted the Iran deal, saying that “clear-eyed and principled diplomacy” had prevailed.

“We cannot close the door on diplomacy and we cannot rule out peaceful solutions to the world problems,” said Obama. “Tough talk and bluster may be the easy thing to do politically but it's not the right thing for our security.”

“For the first time in a decade, we have halted the progress of the Iranian nuclear program,” the president said.

On Saturday, negotiators with the P5+1 international group — consisting of the U.S., United Kingdom, France, Germany, Russia and China — reached a deal with Iran that would see Tehran freeze elements of its nuclear weapons program and allow greater access to inspectors in exchange for limited sanctions relief.

The agreement also opens the door to further talks on Iran’s nuclear program. Tehran says its program is for peaceful energy purposes, but the international community fears Iran is building weapons and enacted crippling economic sanctions to halt nuclear development.

But the diplomatic breakthrough has met with a firestorm of opposition, with key U.S. ally Israel and many on Capitol Hill opposing the deal, which critics say undermines the international sanctions regime and does not do enough to stop Iran's nuclear program.

Israeli Prime Minister Benjamin Netanyahu called the deal a “historic mistake.”

Obama spoke with Netanyahu on Sunday, reassuring him that the two nations had a “shared goal of preventing Iran from obtaining a nuclear weapon” and vowing to “consult closely” with the U.S. ally.

A bipartisan group of lawmakers are also vowing to pass further tough sanctions on Iran. The administration, though, warns that those new sanctions could undermine the deal and cost the U.S. the chance for a negotiated resolution.

Obama has urged time for diplomacy to work, arguing that he will ramp up sanctions if Iran fails to honor its international commitments and that all options — including military action — remain on the table.

“We cannot rule out peaceful solutions to the world’s problems. We cannot commit ourselves to an endless cycle of conflict," said Obama on Monday.

“I firmly believe in what President Kennedy once said: 'Let us never negotiate out of fear. But let us never fear to negotiate,'” the president added.