A US geologist who spent more than seven years in a Chinese prison thanked his jailers for making him and his family stronger, in a statement quoting US civil rights champion Martin Luther King and Russian novelist Fyodor Dostoevsky.

Feng Xue, who was convicted on state secrets charges, was immediately deported upon leaving jail in Beijing last week, the US-based Dui Hua Foundation said in a statement.

In an emotional letter reflecting on his ordeal and posted online by his PhD advisor David Rowley, Xue wrote: “I am starting a new chapter of my life, during which I shall make myself worthy of what I have gone through.

“I should also thank those people who plunged my family and me into this agony.

“The anguish made us stronger as a family, gave us an opportunity to prove and further build our character, and offered us a chance to shed old baggage and start a new chapter of our lives.”

Xue returned to the US city of Houston and was reunited with his family on Friday, according to Dui Hua, which advocates for clemency and better treatment for prisoners in China.

As he stepped from the airplane onto US soil, he wrote, “I recited Fyodor Dostoevsky with tears welling up in my eyes: ‘There is only one thing I dread: not to be worthy of my sufferings’.”

He added: “Every single cell in my otherwise aching body is singing ‘Free at last, free at last’.”

Some Chinese officials tried but failed to prove him innocent or secure his earlier release, Xue said. “They taught me that the beauty of humanity can be found anywhere.”

Xue — whose letter was headed using Western name order — asked for privacy as he and his family begin “the process of recovery from this agonizing experience”.

A Chinese-born US citizen, Xue was first detained in November 2007 over the sale of a database on China’s oil industry while working for US energy and engineering consulting firm IHS.

In February 2011, a Beijing court upheld his 2010 conviction and eight-year sentence. The following year he was given a 10-month reduction for good behaviour, Dui Hua said.

Xue’s arrest and other cases have cast a spotlight on the dangers of doing business in China, especially for those born in China who take on a foreign nationality.

Australian national Stern Hu, an executive with the mining giant Rio Tinto, was sentenced to 10 years in prison in 2010 on bribery and trade secrets charges, in a case severely criticised by Canberra.

Washington repeatedly raised concerns over whether Xue’s rights were being protected and whether he had access to a fair trial.

Rights activists say China routinely abuses its state secrets laws, often as a means of silencing government critics.