Top Republicans reacted sharply to the release of American prisoners held in Iran in exchange for clemency for Iranian sanctions violators in the U.S., suggesting the deal constitutes a show of weakness by President Obama that could lead to future detentions of Americans abroad.

While GOP presidential candidates and congressional leaders welcomed the homecoming of the five Americans, including Washington Post reporter Jason Rezaian, their responses are laced with disdain for the deal that allowed them to go free.

A spokeswoman for House Speaker Paul D. Ryan (R-Wis.), for instance, said Saturday that while the speaker was “glad” the Americans were released, he awaited further information on “the ransom paid for their freedom.” And Sen. Ted Cruz (R-Texas), appearing on “Fox News Sunday,” called the deal “problematic,” saying it constituted “negotiating with terrorists.”

AshLee Strong, Ryan’s spokeswoman, stood by the use of the word “ransom” Sunday, after Obama confirmed the U.S. would either free or cease attempts to prosecute a spate of people accused of violating sanctions on Iran and separately settled a longstanding Iranian claim over the seizure of funds the country used to purchase American military equipment in the years before the 1979 Islamic revolution.

“The facts speak for themselves. In exchange for the freedom of four Americans unjustly imprisoned, the president is granting clemency to 7 people charged with sanctions violations, giving up the hunt for another 14 people charged with sanctions violations, and is giving Iran a roughly $1.7 billion cash infusion,” she said.

“I think it’s a very dangerous precedent,” Cruz said. “The result of this — every bad actor on earth has been told go capture an American. If you want terrorists out of the jail, capture an American, and President Obama is in the ‘let’s make a deal’ business.”

However, precedent is actually on President Obama’s side, says a nonpartisan expert on foreign relations and terrorism who points out there is a long, bipartisan history of American presidents negotiating deals to free prisoners with enemy states.

Of Obama’s GOP critics, “They’re better politicians than they are historians,” said Brian Michael Jenkins, a Rand Corp. expert who has written about how governments handled prisoner exchanges and hostage crises.

Sen. Marco Rubio (R-Fla.), speaking on CBS’s “Face the Nation,” called the released Americans “hostages” who were traded “in exchange for prisoners who did commit a crime and were convicted after due process and a trial and everything of that sort.”

“He’s put a price on the head of every American abroad,” Rubio said. “Our enemies now know that if you can capture an American, you can get something meaningful in exchange for it. … When I become president of the United States, our adversaries around the world will know that America is no longer under the command of someone weak like Barack Obama and it will be like Ronald Reagan, where as soon as he took office the hostages were released from Iran.”

But Rubio’s invocation of the 1979-1981 Iran hostage crisis was particularly specious, Jenkins said, because the situation was nowhere as simple as Rubio described it. It wasn’t the case, he said, that the release was simply prompted by a tough-talking Reagan’s inauguration — rather, diplomats under President Jimmy Carter negotiated a resolution finalized on Carter’s last full day as president. Carter secured the 52 hostages’ release in exchange for the unfreezing of Iranian assets, an American pledge not to meddle in internal Iranian affairs and the creation of a framework for resolving post-revolution financial claims.

“There were concessions in return for getting them back,” Jenkins said.

And while Reagan’s pledge not to “pay ransom” to the Iranians, coupled with Carter’s determination to secure a deal while president, clearly forced the crisis’s resolution, Reagan’s tough talk didn’t continue to guide his administration’s actions. Senior Reagan administration officials later went on to engage in secret talks with Iran to gain the release of hostages held by Iranian client groups in Lebanon. The deal negotiated by the Reagan officials included the sale of arms to Iran, the proceeds of which were funneled to right-wing rebels in Nicaragua, later exploding into the Iran-Contra affair.

Even before the Iran hostage crisis, Jenkins noted, presidents exchanged prisoners with America’s sworn enemies — particularly with the Soviet Union, which in many cases held prisoners for charges just as trumped-up as those against the American prisoners released this past weekend. The first East-West Cold War prisoner exchange was dramatized in last year’s Hollywood movie “Bridge of Spies,” and similar prisoner exchanges continued into the ’80s under Reagan — including the 1986 exchange of Soviet dissident Natan Sharansky for the CIA mole Karl Koecher.

A top congressional Democrat pushed back on the Republican efforts to cloud the prisoners’ release Sunday. Rep. Adam Schiff (D-Calif.), the ranking member of the Permanent House Select Committee on Intelligence, said the release “ought to be cause for celebration, not political condemnation.”

“I think most Americans are thrilled that these fellow citizens are coming home,” he said. “The few Americans who don’t seem pleased all seem to be running for president.”

The specter of global terrorism might well have changed the perception of prisoner exchanges in the U.S. The 2014 deal by Obama  to secure the release of soldier Bowe Bergdahl for the eventual release of five senior Taliban figures from Guantanamo sparked sharp concerns about national security and whether Obama hewed to the four-decade-old U.S. policy of not negotiating with terrorist groups.

But Jenkins said the deal to release the five Iranian captives differs in crucial ways from a “ransom” paid for a hostage — the most important being it was negotiated not with a terrorist group holding a kidnapped American, but with a nation that took Americans into custody on its soil under its sovereign powers. That’s a  distinction carrying profound meaning in the realm of foreign affairs and international law, despite the fact the U.S. continues to list Iran as a state sponsor of terrorism and Iran’s behavior.

“We may dispute the circumstances, but this would fall into the category of wrongful detention,” Jenkins said — the exact sort of situation that has historically been resolved through deals to free prisoners.