Republicans running for President Barack Obama's job celebrated news of the release of five American prisoners from Iran on Saturday, while continuing to disparage the administration that negotiated the deal. 

News of the release, part of a prisoner swap in which the U.S. offered clemency to seven Iranians, came as Secretary of State John Kerry and his Iranian counterpart were finalizing the deal to end economic sanctions on Iran, part of nuclear non-proliferation deal that Republican presidential candidates have decried and vowed to end if they are elected. 

In a measure of how sensitive the reopening of relations with Iran remains, almost 35 years to the day after that Islamic state released 52 American hostages following more than a year of captivity, Democratic front-runner Hillary Clinton also carefully qualified her expression of relief over the prisoners' release.  

While Clinton supports the Iran nuclear deal and said Saturday that she is "proud of the role I played to get this process started" as Obama's first secretary of state, she said in a statement released by her campaign: "We shouldn't thank Iran." Noting that the released Americans were "held unjustly by a regime that continues to threaten the peace and security of the Middle East," Clinton also called the treatment of Navy sailors who were briefly detained by Iran earlier this week "offensive, including the release of a demeaning and provocative video." Republicans have been decrying the video on the campaign trail this week. Paraphrasing a phrase that the late President Ronald Reagan used about his approach to the Russians, Clinton said that when it comes to Iran, "as president, my approach will be distrust and verify."

The praise from Clinton's chief rival for the Democratic nomination, U.S. Senator Bernie Sanders of Vermont, was unqualified: "This good news shows that diplomacy can work even in this volatile region of the world," Sanders said in a statement.

But Republicans were harshly critical of the negotiations that led to Saturday's prisoner release and the end of economic sanctions against Iran.

"I want to start by giving thanks on news we got today that four Americans are coming home," U.S. Senator Ted Cruz of Texas told a gathering of about 600 Tea Party activists in Myrtle Beach, South Carolina, but he went on to denounce the deal that brought them back as "a piece of propaganda for both Iran and the Obama administration."

"We’ve got to shake our head with how it’s happened. The details of this deal are still coming out. You notice the Obama administration has announced the good news but hides the bad news," Cruz told the cheering crowd, as he denounced the release of "seven people who were incarcerated for violating the sanctions on Iran and helping Iran obtain nuclear weapons."

Singling out one of the prisoners Iran is releasing, Pastor Saeed Abedini, Cruz added "there is a false moral equivalence in a deal like this. Pastor Saeed Abedini was in prison for the crime of preaching the Gospel. He shouldn’t have been there."

Other candidates were equally critical, with a partial exception: Jeb Bush told reporters in New Hampshire that while he agrees "there isn't much symmetry" in the sets of prisoners that the two nations are exchanging, "I'm not being critical of the deal without knowing all the facts." But the former Florida governor, a brother and son of former presidents, went on to blast the Obama administration for "tripping all over itself" to protect the nuclear deal. "They're missing the larger point, which is that we need to confront the ambitions of Iran on a larger basis."

Like many Republicans, Bush believes that the Iranians can't be trusted not to develop nuclear weapons, despite a regime of international inspections imposed by the deal.

Speaking to the South Carolina Tea Party convention hours after Cruz, Republican front-runner Donald Trump focused on the fact that Iran got a reported seven prisoners back in the swap, plus billions of dollars in economic benefits with the end of sanctions. In return, "we’re getting back four people that didn’t do anything wrong," said the billionaire author of The Art of the Deal. "That’s the way we negotiate. It’s so sad. It’s so sad." 

Former Arkansas Governor Mike Huckabee questioned why the Obama administration agreed to talks with a country that was holding U.S. citizens. "It's great that these prisoners have been released," the Washington Post quoted Huckabee as telling reporters at the South Carolina Tea Party event. "They should have been released before we ever sat down at the negotiating table."

In Iowa, New Jersey Governor Chris Christie said he is "grateful" for the Americans' release, before attacking Obama: "The concern I have, and we don’t know yet, is that the president made a trade. Now, when this president makes trades, this is a big problem," he told a crowd at a town hall in Ames, Iowa, according to a transcript released by his campaign.

"This is not a guy I would let negotiate buying a car for me, let alone anything else. I mean he makes bad deals and he seems to become an expert at making bad deal with the Iranians," Christie added.

Also in Iowa, U.S. Senator Marco Rubio told reporters the swap “tells us everything we need to know about the Iranian regime -- that they take people hostage in order to gain concessions,” Time reported. “And the fact that they can get away with it with this administration I think has created an incentive for more governments to do this around the world.”

Ben Carson, in a statement released by his campaign, expressed similarly mixed feelings. "I am very pleased that five American citizens, who were illegally imprisoned by Iran in flagrant violation of longstanding international human rights norms, have finally been released," the retired neurosurgeon said. "However, the fact remains that President Obama's nuclear agreement with Iran is fatally flawed," Carson added, vowing: "If I am elected president, I will withdraw from this dangerous agreement on day one."

Senator Rand Paul of Kentucky said he was “hopeful that this means Iran is going to begin behaving in a more civilized fashion,” the Washington Post reports.

(Contributing: John McCormick)