The Iranian-American dual citizen from San Diego who was arrested and sentenced to 18 years in prison in Iran has been released on bail, friends of the family confirmed to The Foreign Desk.

GholamReza “Robin” Shahini, 46, was freed from the prison he was held in Gorgan after presenting a 200 million Toman bail; Roughly $54,000 U.S. dollars.

Shahini, who was originally charged with allegedly ‘collaborating with a foreign government’ and for posts he published on his social media page, will not be able to leave Iran until an appeals court approves his release, a close friend told The Foreign Desk.

“We were in total shock. We totally did not expect this and just knowing that he is out of prison is extremely good news,”Sarah, a close friend who is familiar with the details of the case and who did not want her full name disclosed for security purposes, told The Foreign Desk.

A resident of San Diego for the past 16 years, Shahini disappeared after traveling from California to Iran last summer to visit his sick mother.

While in prison, Shahini penned a suicide note, exclusively obtained by The Foreign Desk, and over the last month, he carried out a hunger strike from which he became extremely weak and frail.

According to his family, Shahini continued to suffer from severe asthma over the course of his imprisonment and was not given proper medical attention.

Shahini first came under the government’s radar for his supposed participation in Iran’s Green Revolution in 2009 and a TV interview with the US’ State Department-backed Voice of America, according to the indictment originally brought against him by a Revolutionary Court.

Shahini kept an active Facebook profile in Farsi and has been a vocal critic of the country’s deplorable human rights record. The page was deleted within days of his disappearance.

Coincidentally, Shahini’s last trip to Iran was in 2009, during the country’s Green Revolution over a contested presidential election.

This past summer, Shahini traveled from San Diego to Gorgan, a city roughly 250 miles northeast of Tehran to spend time with his ailing mother.

According to his family, agents from Iran’s Revolutionary Guard visited his mother’s home July 11 and arrested Shahini. Guards also seized his laptop and mobile phone and warned his family not to speak to the media.

In August, a website with ties to the country’s Revolutionary Guard, published two photos of Shahini that were purportedly taken from his laptop or phone. The photos show him meeting with Abolhassan Banisadr, a former Iranian president living under exile in France and one with Reza Pahlavi, son of the late Shah Mohammad Reza Pahlavi.

The website alleges that Shahini has close ties with Pahlavi’s National Council of Iran, an organization created to overthrow Iran’s theocratic dictatorship and that Shahini was sent by U.S. intelligence services to create turmoil in Iran.

The Foreign Desk cannot confirm the authenticity of the photographs.

A surge in arrests of dual-nationals by Iran has followed last year’s July nuclear accords in what experts suggest is political jostling by hardliners looking for increased leverage with the West.