Former Secretary of State John Kerry lobbied for the Iran nuclear deal on Wednesday by saying it helped the U.S. avoid armed conflict, and that leaders of some Middle East countries wanted the U.S. to attack Iran.

"We were hurtling toward conflict," Kerry said at an annual retreat of "mediators and peace process actors" in Oslo, Norway. "I mean, there's just no other way to describe it."

"Leaders in the region were saying to me personally, and to the president, President Obama, you should bomb these guys," Kerry said. "That's the only way to resolve this issue."

"And we chose a different path," he said. "What we did is to find a mutually acceptable way to guarantee that both sides were able to agree on a path forward that met both sides' needs."

President Trump has criticized the Iran agreement, but has yet to take any step to step away from it. Before he took office, Trump indicated that he might deal with it by insisting on strict enforcement from Iran's side.

But Kerry said the deal is still working.

"It is working," Kerry said. "The world is safer."