In this case, however, Iran has said that it will not take part in any renegotiation of an accord it also hammered out with three European countries, as well as with Russia and China. Persuading the Europeans — Britain, France and Germany — to reopen the negotiations could prove almost as difficult.

Even getting Congress, which is deeply divided on the Iran deal, to agree on additional legislation may be beyond Mr. Trump’s political skills. Given the drive by some Republicans to strike down the deal and the determination of some Democrats to preserve it, it is entirely possible that Congress will do nothing.

On Thursday evening, Senator Bob Corker, Republican of Tennessee and the chairman of the Foreign Relations Committee, released a potential blueprint toward imposing an automatic snapback of sanctions if Iran was believed able of producing a nuclear weapon within a year, or if it violated other restrictions. Mr. Corker worked on the proposal with administration officials and Senator Tom Cotton, the Arkansas Republican who is a hard-liner on Iran policy, and predicted it could earn bipartisan support.

Mr. Trump’s decision came after a fierce debate inside the administration, according to a senior official familiar with the discussions and who agreed to describe them on condition of anonymity.

Secretary of State Rex W. Tillerson and Defense Secretary Jim Mattis argued that it was in the national security interests of the United States to keep the deal’s constraints on Iran. The two men succeeded, over time, in persuading Mr. Trump not to immediately scrap an accord that he had said during last year’s presidential campaign was a “disaster” and the “worst deal ever.”

Twice, Mr. Trump reluctantly certified the agreement. But administration officials concluded that he could not bring himself to do that every 90 days, even if the judgment of nuclear inspectors and his own intelligence agencies was that Iran was in compliance.

So they tried to find a solution that would allow Mr. Trump to signal his disapproval of the deal without putting the United States in the position of being the first signatory to violate it. That solution was to declare that Iran was violating the “spirit” of the accord and that the entire agreement was no longer in the United States’ national security interests — even while acknowledging that Tehran had lived up to the letter of the agreement.

For its part, Iran has rejected both reopening the existing agreement and negotiating a successor agreement that would extend the restrictions on producing nuclear fuel beyond the 15 years in the original accord.

Asked last month about the possibility of new negotiations to extend the duration of restrictions on Iran, Iran’s foreign minister, Mohammad Javad Zarif, said in an interview, “Are you prepared to return to us 10 tons of enriched uranium?”

That relinquished stockpile — one of Iran’s biggest concessions — was about 98 percent of the nuclear fuel holdings in the country’s possession and was the key assurance that Tehran could not rapidly produce a nuclear weapon.

The Trump administration said new legislation could address what it views as one of the major weaknesses of the agreement: its “sunset” provisions, under which the restrictions on Iran’s nuclear activities expire in stages, starting in less than a decade.

But the most critical restriction in the deal — one limiting how much nuclear fuel Iran can produce — expires in 2031, years after Mr. Trump leaves office. And after that, Iran would still be prohibited from producing a nuclear weapon, and would be subject to highly intrusive inspections.

The administration vowed to increase the pressure on the Islamic Revolutionary Guard Corps, saying it would go after “funding for its malign activities, and oppose I.R.G.C. activities that extort the wealth of the Iranian people.”

But in a move certain to disappoint the most hard-line critics of Iran, Mr. Trump will not designate the Revolutionary Guards as a foreign terrorist organization. Such a designation, the administration said, would impede military operations in which American and Iranian forces found themselves on the same battlefield — presumably fighting the Islamic State.

The deal Mr. Trump is backing away from was viewed by Mr. Obama as the crowning foreign policy achievement of his presidency. Years of sanctions and sabotage — including the first known American cyberattack on another country’s nuclear facilities — brought the Iranian government to the negotiating table. At first, Mr. Obama and his then secretary of state, Hillary Clinton, secretly sent two trusted emissaries to meet with Iranian officials.

Then the 2013 election of a moderate as Iran’s president created a diplomatic opening. What followed were intense, often bruising negotiations that lasted two years, ending in a weekslong negotiation in Vienna at which the final agreement was reached. The agreement runs over 140 pages, with detailed timelines, rules for inspections and descriptions of what kind of equipment Iran can build and how much nuclear material it can produce.

Former Secretary of State John Kerry called it one of the most restrictive arms control agreements in history. Mr. Trump called it a disaster, telling The New York Times in interviews during the campaign that he would have walked out of the room rather than agree to it.

But as president, he discovered that his early threat to abandon the agreement was harder to execute than he thought. Leaving the agreement would actually free Iran to resume the enrichment of uranium, once again putting Tehran at the cusp of nuclear ability.

In private, Mr. Mattis argued that against an already-brewing confrontation with North Korea, he did not want to have to worry about a nuclear Iran at the same time. That is what led to the face-saving compromise the president will announce on Friday, under which Mr. Trump will tell Congress that Iran is not complying with the “spirit” of the deal, even while his aides concede it has not violated its terms.