Iran's President Hassan Rouhani addresses Iranians in a televised speech after the nuclear agreement was announced on Tuesday. (Ebrahim Noroozi/Associated Press)

THE HISTORIC agreement announced by the United States and its partners with Iran on Tuesday offers the welcome prospect that, for the next 15 years, the Islamic republic will be restrained from producing a nuclear weapon. According to President Obama, it also opens “a different path” for a country that has been a determined American enemy for 35 years, “one of tolerance and peaceful resolution of conflict . . . more integration into the global economy, more engagement with the international community.”

Though Mr. Obama didn’t say so, these two very disparate outcomes — one tangible, technical and backed by guarantees, the other broad, political and speculative — are closely linked to one another. If the transformation of Iranian behavior the president hopes for does not occur, the deal on its nuclear program may ultimately prove to be a poor one — a temporary curb that, when it lapses, will enable a dangerous threshold nuclear state that poses a major threat to the United States and its allies.

As it is, the bargain is complex and costly — if ultimately preferable, in the short term, to the likely alternative of an escalating confrontation with Iran. Its most immediate effect will be to provide Tehran with up to $150 billion in fresh assets from sanctions relief over the next year, funds that its leaders will probably use to revive the domestic economy but also to finance wars and terrorist groups in Iraq, Syria, the Gaza Strip, Yemen and elsewhere.

Though Mr. Obama has promised to mitigate that outcome with new support for Israel and U.S. Arab allies, one effect of the deal may be an increase in the sectarian bloodshed wracking the region, as well as the conventional threat to Israel. When embargoes on arms and missile sales to Iran expire in five and eight years, that threat could further escalate, and Tehran could seek missiles capable of striking U.S. warships in the Persian Gulf or reaching the U.S. homeland.

The world is promised a 98 percent reduction in Iran’s stockpile of enriched uranium, which is currently large enough to produce 10 bombs, and the mothballing of two-thirds of its 19,000 centrifuges. Enrichment will be limited to one heavily monitored facility, and though Iran will be allowed to work on more advanced centrifuges, none can be installed for a decade. These strictures, according to the administration’s experts, will keep Iran a year away from producing a weapon during that time — provided that it does not cheat by secretly conducting nuclear work elsewhere.

Because Iran twice has been caught in such clandestine work, that is a critical concern — and the provisions for deterring and detecting violations are the areas in which Tehran fought for, and won, some troubling compromises. International inspectors seeking access to a suspected Iranian site could be delayed by a 24-day, multi-step process ultimately requiring five votes on an eight-member committee; at a minimum, the United States and four European representatives would have to concur. While a U.S. president could, in theory, unilaterally determine that Iran was cheating and force the reimposition of U.N. sanctions, it could take 65 days and might prove politically unworkable.

Mr. Obama sketched a dark picture of the alternative to the agreement, in which the world would refuse to join in sanctions, Iran would step up its nuclear activities and the risk of war would grow. Whether the administration could have held out for a better bargain is certainly debatable; Mr. Obama settled for terms far short of those he originally aimed for. But with the deal now done, its rejection by Congress would likely create the unfavorable scenario the president describes. Whether he is right in claiming that his successor in 10 or 15 years “will be in a far stronger position” with Iran will depend on whether his hopeful theory about its political future proves correct.