This May 2016 photo released by a family member shows Robin Shahini during his San Diego State University graduation ceremony in San Diego, Calif. (Uncredited/AP)

The Iranian government in recent weeks has handed down a string of lengthy prison sentences to American citizens born in Iran, a move that experts say could signal the country’s interest in a prisoner swap or payoff.

A San Diego man received an 18-year sentence on Monday, according to his girlfriend, who spoke over the phone with him after he was convicted of collaboration with a hostile government — the United States — and blasphemy.

Reza “Robin” Shahini’s conviction, first reported by Vice News, comes one week after two U.S. citizens, Siamak Namazi and his 80-year-old father, Baquer Namazi, each got 10 years in prison on the same charge of collaborating with the U.S. government.

The sentences underscore a power struggle within Iran in advance of March elections, with the country’s hard-liners angling for leverage to get some kind of deal, said several Iran scholars.

“They’re bargaining people’s lives as if they’re trading Persian carpets,” said Karim Sadjadpour, a Middle East analyst at the Carnegie Endowment for International Peace. “Oftentimes, these almost comically harsh sentences are simply meant to increase the value of these prisoners in the event of any quid pro quo with the United States.”

Meanwhile, other parts of Iran’s government are enjoying international acclaim for their cooperation with the United States on the historic nuclear agreement reached last year.

Only days before Shahini’s sentencing, Secretary of State John F. Kerry and Iranian Foreign Minister Mohammad Javad Zarif were named winners of Britain’s Chatham House Prize for successfully negotiating the nuclear ­accord with Iran and six world powers. The day it was implemented, Iran freed four U.S. citizens in a prisoner swap, including Washington Post reporter Jason Rezaian, and received a down payment on a $1.7 billion settlement in a long-standing legal dispute.

Shahini emigrated to the United States in 2000 and settled in San Diego. He ran a pizzeria that failed during the recession and a car-repair shop that he sold to become a full-time student. He earned his bachelor’s degree in international conflict resolution at San Diego State University and was about to enter graduate school there when he was arrested in July on a visit to see his mother. He became a naturalized citizen in 2009.

The Iranian government’s only evidence against him consisted of photocopies of postings Shahini made on Facebook and a blog, said his girlfriend, who agreed to a telephone interview only if her name was not published because she fears for her family in Iran.

Arrests of other dual nationals, a status Iran does not recognize, have also fueled perceptions that Iranian hard-liners are setting the stage for a deal and trying to deter contact with Westerners. Last month, Nazanin Zaghari-Ratcliffe, a British American woman, was sentenced to five years a day before London upgraded its diplomatic relations with Tehran.

In the case of Nizar Zakka, a legal resident of the United States who was arrested by the Iranian government last year, captors told him that he would be freed only if a ransom was paid, according to his lawyer. Zakka, a citizen of Lebanon whom Iranian state media have called a spy for the United States, was sentenced last month to 10 years.

“Just last month, Nizar was then told he was spared the death penalty but would remain in captivity for 10 years and until $4 million is paid to Iran,” said Jason Poblete, Zakka’s lawyer.

Haleh Esfandiari, a Wilson Center scholar who was herself imprisoned in Iran for more than three months in 2007, said the escalating length of the recent sentences suggest that the price tag will continue to rise.

“There is definitely no end to it,” she said. “Depending on who the next person is, they might get 25 years.”

State Department spokesman John Kirby said the United States is sticking with its policy of not paying ransom for prisoners. The administration came under fire from Republican lawmakers after paying the first installment on the $1.7 billion settlement in January. Officials note that the January payment gave Iran its own money, which had been held in the United States after the 1979 revolution. Critics said the timing and the fact that it was an all-cash payment made it look like ransom nevertheless.

“We haven’t changed our policy,” Kirby said Tuesday when asked whether Iranians might believe ransoms would be paid. “We’re not going to change it going forward. If someone in Iran thinks that’s our policy, they are patently wrong.”

In Iran, the argument that the U.S. government is trying to subvert the Iranian revolution has been building since the nuclear agreement was signed last year.

Hadi Ghaemi, head of the New York-based International Campaign for Human Rights in Iran, linked actions by Iran’s security apparatus to several speeches over the past year by the supreme leader, Ayatollah Ali Khamenei, warning that Americans are trying to infiltrate society and influence the upcoming elections. President Hassan Rouhani, the relative pragmatist who negotiated the nuclear deal, is seeking reelection.

“They have no evidence, but they’re building a case that the agents of infiltration are here,” he said of the Islamic Revolutionary Guard Corps, which is aligned with the hard-liners and works closely with prosecutors and judges. “The idea is to show Rouhani cannot succeed, and contribute to the disillusionment with him. I’m concerned this could be the unraveling of Rouhani’s presidency if the pattern continues.”

Barbara Slavin, acting director of the Future of Iran Initiative at the Atlantic Council, compares Iran to a porcupine, using its sharp, pointed policies to ward off domestic danger from economic openings that come with the nuclear deal.

“They want to present this fearsome appearance to the outside world,” she said. “They do it in a variety of ways. Through chanting ‘Death to America, death to Israel.’ Through support for groups like Hezbollah and Hamas. And they do it with provocative actions in the Persian Gulf, and arresting people on absurd charges. It’s part of the strategy to keep everybody on their toes to make sure people going to Iran on business deals don’t get involved in politics.”

Shahini’s sentence has not been officially announced, not even on Iranian media sites linked to the judiciary.

News of his fate came Monday, Tehran time, when he called his girlfriend in California from a public phone in the prison in the northern Iranian city of Gorgon to tell her of his sentence. The girlfriend said she patched the call through to a reporter from Vice News, which aired its interview Monday night.

Shahini told Vice that he “just laughed” after hearing his sentence, and vowed to go on a hunger strike.

“He’s crushed and shocked,” said the girlfriend. “We expected prison, but not 18 years.”