WASHINGTON—President Barack Obama called the framework nuclear deal with Iran a “historic understanding” between the two estranged nations, but he hinted at its fragility by noting the success of a final accord is far from guaranteed.

Mr. Obama, in remarks in the Rose Garden Thursday afternoon, said the framework deal, if completed, would block any pathway for Tehran to acquire a nuclear bomb and argued that the only real alternative to continued diplomacy is war.

“I am convinced that if this framework leads to a final, comprehensive deal, it will make our country, our allies, and our world safer. This has been a long time coming,” Mr. Obama said. He added, “It is a good deal, a deal that meets our core objectives.”

“Our work is not yet done. The deal has not been signed,” Mr. Obama also said. “And success is not guaranteed.”

Mr. Obama faces several potential obstacles to reaching a full agreement by a June 30 deadline, including Congress, U.S. allies in the Middle East and the Iranian regime.