WASHINGTON (Reuters) - President Barack Obama pardoned three Iranians charged with sanctions violations as U.S. authorities moved to drop charges or commute prison sentences on Saturday for five other men, part of a stunning and secretly negotiated deal that saw four Americans freed by Iran.

U.S. President Barack Obama delivers remarks at the University of Nebraska Omaha arena in Omaha, Nebraska, in this file photo dated January 13, 2016. REUTERS/Carlos Barria

The deal removed a major source of acrimony standing in the way of further rapprochement between the long-time foes, but opened the Obama administration to immediate criticism that it had agreed to a bad deal that would set a dangerous precedent.

It also represented a reversal of the past five years of U.S. policy, during which U.S. law enforcement prosecuted illicit trade with Iran, even in common consumer items, as a threat to national security.

The prisoner deal with Iran came the same day major powers began to lift economic sanctions against Tehran in exchange for steps to curb its nuclear program, implementing an international nuclear agreement.

Republicans welcomed the release of Americans but criticized the leniency shown towards Iranians charged with violating sanctions which U.S. officials credit with pressuring Iran to make concessions on its nuclear program.

“(They were released) in return for people that violated Iran sanctions, Iranians that were in prison here for violating those sanctions,” said Republican presidential candidate Jeb Bush in New Hampshire on Saturday. “Every time we show weakness it is a victory for Iran.”

The White House said it had offered clemency to seven Iranians, six of whom were dual U.S.-Iranian citizens. In addition, the U.S. State Department said it had withdrawn international arrest notices for 14 Iranians wanted on sanctions violations.

U.S. officials declined to detail the cases but said Obama had exercised his power to pardon and commute sentences for the Iranians, who they said posed no danger to the United States.

Joel Androphy, a lawyer for Bahram Mechanic, said his client and two others, Tooraj Faridi and Khosrow Afghahi, had been granted pardons by Obama. They were accused in 2015 of shipping electronics to Iran. Mechanic and Afghahi were being held without bail in Houston, while Faridi was out on bail. All three are Iranian-American dual citizens and had pleaded not guilty.

Androphy said on Saturday afternoon that Mechanic and Afghahi had not been released yet and that their release would come when the four American prisoners left Iran. U.S. officials said on Saturday evening that the four Americans had not yet left Iran while logistical steps are being completed, but that a fifth prisoner, released independently of the prisoner swap, has left the country. (Read our Jan. 12 story here)

“We’re ecstatic that the president has decided to pardon them for basically trade issues,” Androphy told Reuters, adding that his client had plans to eventually visit Iran again.

A lawyer for Faridi welcomed the news on Saturday, and said his client did not plan to return to Iran.

“He has no plans to go back to Iran for a visit,” said Kent Schaffer, Faridi’s attorney. “He fought hard to get here and he wants to stay here.”

The three men were among 12 Iranians in the United States identified by Reuters this week as being imprisoned for or charged with sanctions violations. (Read our Jan. 12 story here)

The U.S. Justice Department also moved on Saturday to drop sanctions charges against four other men who are outside the United States, according to electronic court filings. Citing “significant foreign policy interests”, federal prosecutors in Massachusetts, New York, California, and Texas asked federal judges early Saturday to dismiss charges against them.

U.S. authorities have considered three of them fugitives and had been seeking extradition from Malaysia for one.

Authorities were also working to obtain early release for Ali Saboonchi, convicted of export violations in 2014, according to people familiar with the matter. Between 2009 and 2013, Saboonchi and several associates tried to export industrial parts to customers in Iran, according to an indictment filed in 2013. He was sentenced to two years in prison and was due to be released in November 2016.

U.S. officials characterized the move as a humanitarian gesture, but some experts said the leniency toward Iranians accused of sanctions violations could set a bad precedent.

The pardons will discourage prosecutors from bringing similar sanctions enforcement cases, which are complicated and can take years to prosecute, said David Hall, a former federal prosecutor in Pennsylvania and Delaware who investigated and brought charges on Iran sanctions cases.

“They’re already hard enough and that’s the reason there are so few of them to begin with,” Hall said.

Dozens of Iranians have been charged with U.S. sanctions violations since 2008.

Melissa Visconti, a former federal prosecutor who brought numerous Iran sanctions-busting cases, said that while she had “mixed feelings” about the exchange, she was confident the U.S. Justice Department had vetted the cases carefully before signing off on any release.

“The Justice Department is not going to release someone who is going to be a danger to American citizens,” Visconti said. “If these guys are being released, it means they are not very high up on the food chain.”

A spokesman for the Justice Department referred questions to the White House.

The electronic filings came hours before U.S. officials said the Americans being held in Iran were being released.