The Obama administration went out of its way in early 2016 to help Iran recoup previously sanctioned oil revenue stranded in an overseas account after the nuclear deal went into effect and actively misled Congress regarding those efforts, according to the results of a nearly two-year Republican investigation released Wednesday.

The majority report of the Senate’s Permanent Subcommittee on Investigations comes as President Trump, who scorned the nuclear agreement from its inception, last month ended U.S. participation in what he called a “horrible, one-sided deal.”

By lifting certain sanctions in exchange for restrictions on Iran’s nuclear activity, “this disastrous deal gave this [Iranian] regime — and it’s a regime of great terror — many billions of dollars, some of it in actual cash — a great embarrassment to me as a citizen and to all citizens of the United States,” Trump said in announcing the withdrawal.

But the unfreezing of Iran’s U.S. accounts would be the end of it, the Obama administration said at the time. Both before and after the deal was implemented, officials repeatedly told Congress that Iran, under remaining non-nuclear sanctions, would have no access whatsoever to the U.S. financial system or institutions.

The subcommittee believes it has found at least one example where that was not the case and where President Barack Obama’s Treasury and State departments went out of their way to bend the rules for Iran.

The report chronicles the previously unpublished saga of Bank Muscat in the Persian Gulf state of Oman, which, as the agreement was implemented in January 2016, found itself holding $5.7 billion belonging to Tehran. The money was payment from countries that purchased Iranian oil under a partial, pre-deal easing of sanctions.

Under the nuclear agreement, Iran was entitled to withdraw the funds, but it had made the mistake of having them held in Omani ­rials, one of the least convertible currencies in the world.

Tehran wanted euros. The most viable path to convert such a large amount of rials, for reasons having to do with the obscurity of the Omani currency and the massive U.S. role in the global financial system, was through the U.S. dollar and an American bank, preferably one of two American banks that had corresponding relationships with Bank Muscat.

It would take only seconds, and Iran wouldn’t even be directly involved. A computer message from Oman would arrive at the U.S. institution, which would then send a message to another bank in Europe.

To facilitate the transaction, Obama officials engaged in lengthy discussions with Iranian and Omani officials; appealed to the two American banks to undertake the transfer; privately issued a special Treasury license that would guarantee it was allowed under still-existing U.S. sanctions; and even approached the New York Federal Reserve Bank for help.

At the end of the day, nothing worked. Eventually, according to the report, Oman took a slower and more complicated route, gradually buying small amounts of ­euros in Europe that could be transferred to Iran. No one involved seems certain whether Iran has yet received all of its $5.7 billion.

In undertaking the effort and not disclosing it to Congress, subcommittee Chairman Rob Portman (R-Ohio) said in an interview, “the Obama administration misled the American people by saying that Iran was not going to be granted access to the U.S. financial system. I think they did it because they were so eager to get an agreement with Iran.”

Such access, said Portman, a longtime opponent of the Iran deal, “is the crown jewel, what all these countries would love. Yet our government offered it while at the same time telling the American people they weren’t offering it.”

In a Thursday tweet on the report, Trump erroneously called the issuance of the license “totally illegal,” a charge the subcommittee investigators did not make. Tying the issue to the current special counsel investigation of possible ties between Russia and his campaign, Trump called on investigators to redirect their efforts to what he said were accusations that the Obama administration tried to “give Iran secret access” to the U.S. financial system.

A former Obama official countered that issuing a “narrow specific license” for the transaction “cannot be described as granting access to the U.S. financial system.” Administration actions did not authorize Iran to conduct dollar transactions or business with U.S. banks or provide entry to the U.S. system.

The nuclear agreement committed signatories “to give Iran access to pools of its money held overseas.” U.S. efforts in this case, said the former official, who spoke on the condition of anonymity to avoid fueling the issue, were “aimed solely to allow the movement of Iran’s own funds” from a third country to a European bank, “where Iran could then make use of them.”

Although the subcommittee’s Democratic minority sat in on many of the investigation meetings, which began in the summer of 2016, it did not sign on to the report. “This was something that definitely was a Portman majority priority that we were just monitoring. He did this work, and he can release it,” a minority staff member said. The staffer also spoke on the condition of anonymity, directing questions to the subcommittee’s ranking Democrat, Sen. Thomas R. Carper (Del.)

Carper, a longtime supporter of the nuclear agreement, said in a statement that “the Obama administration followed the law and worked to ensure the U.S. upheld our international commitments to the historic Iran deal, which stopped Iran from developing a nuclear weapon. That’s what leaders do.

By withdrawing from the deal, which was also signed by France, Britain and Germany, Carper said, “President Trump has abandoned our allies, put our national security at risk and weakened our standing in the world.” Focusing now on the unsuccessful Oman effort, he said, “doesn’t seem to be the most pressing priority.”

The 52-page report makes its case with public testimony from 2015 and 2016 — primarily by then-Treasury Secretary Jack Lew and then-acting undersecretary for terrorism and financial intelligence Adam Szubin — letters between the administration and Congress, and interviews with officials still in government, along with internal communications they apparently made available.

It does not accuse anyone of lying. Instead, it lays out the details of anxious, behind-the-scenes administration attempts, in the early months of 2016, to resolve an unforeseen kink in the agreement and to carefully parse public statements in a way that made them disingenuous if not false.

Three days after the deal was implemented on Jan. 16, Bank Muscat contacted Treasury’s Office of Foreign Assets Control (OFAC) to request its help in meeting an Iranian request to get its money in euros. The funds were part of about $13.4 billion in oil earnings Iran had stashed in escrow accounts around the world and to which the agreement gave it unrestricted access.

After 10 days in which nothing happened, a lead Iranian negotiator wrote to State and Treasury officials in dismay, saying that Tehran had “expected free access and use of our funds abroad,” according to the report. Internally, OFAC officials exchanged messages on specifics of U.S. obligations.

“Yikes,” one official emailed another after being informed of wording in the agreement. “It looks like we committed to a whole lot beyond just allowing the immobilized funds to settle out.”

By early February, as a high-level Omani delegation was planning a trip to Washington in search of answers, an OFAC official messaged that “we’ve been working on the issue through the weekend....The Iranians have been emailing me daily.” Iranian Foreign Minister Mohammad Javad Zarif, the report says, raised the issue in a letter to then-Secretary of State John F. Kerry.

Oman did not want to move the money in its possession into one of the U.S. banks, which are not identified in the report, without assurance that it was protected, in the form of a “specific license” from OFAC. Such licenses — normally kept private — are issued for one-off sanctions waivers deemed in the national interest.

After much agonizing, OFAC issued the specific license to Oman. But the American banks, despite direct administration urging and assurances that no problems would befall them, refused to participate in the transaction, according to their representatives who spoke to the subcommittee. The license was never used.

A month later, in the absence of progress, the report notes an email in which an unidentified “Senior State Department Official” told his complaining Iranian counterpart that the failure to convert the assets “is not because of any fault of the U.S. government in not lifting sanctions.” Issuance of the OFAC license, the official wrote, “exceeded our commitments” and the administration was already under political pressure because of perceived “concessions” while Iran continued to behave badly in terms of missile launches and interference in Yemen’s civil war.

Nevertheless, the official said, the administration remained committed to ensuring Iran got “all the benefits it should receive in exchange for taking the historic measures” in the deal.

As the administration tried and failed in other ways to make the transfer happen, and Oman and Iran unsuccessfully appealed to European-based financial institutions to do something, Lew and Szubin were confronted in congressional testimony with concerns that the administration had gone beyond the bounds of the deal, and sanctions that remained in place, to help Iran recoup blocked assets.

Although Lew, according to documents reproduced in the report, had been given Treasury talking points explaining the Omani conundrum, he chose not to mention it in a House hearing in late March. Both officials repeated that, while the administration was committed to providing access to money Iran had a right to, “Iran will not have access to our financial system.”

Portman, echoing the report’s two primary recommendations, called for more executive branch transparency, including information about specific licenses, and warned that no administration should be “so desperate to reach a deal that you cut corners.”

Those principles, he said, should apply to any future agreements with Iran and North Korea.

Shane Harris contributed to this report.