Iran has released a Texas graduate student from jail after five years, state media reported Tuesday.

The government-owned IRAN Daily quoted Omid Kokabee’s lawyer as saying his client will be allowed to enjoy “conditional freedom” for the rest of his 10-year sentence, according to the Associated Press.

The lawyer, Saeed Khalili, said Kokabee, who was released from jail in April for medical treatment, “will not return to prison, any more,” the news agency said.

Kokabee, an Iranian, studied optics in the physics department at the University of Texas. He was arrested in 2011 while visiting his family and was convicted of having “relations with a hostile country” and receiving “illegitimate funds,” the AP said.

The International Campaign for Human Rights in Iran said Kokabee, 34, was jailed for refusing to work on military projects in Iran and was diagnosed with kidney cancer in April after being denied proper medical treatment in prison.

The rights group called on the Iranian judiciary “to immediately allow Kokabee to leave the country if he so wishes, so that he may continue his interrupted scientific studies and career.”