An American pro-democracy activist detained for nine months in Vietnam was released and deported by authorities on Wednesday.

Nguyen Quoc Quan, 59, who has been detained since April, was released after he had “confessed to his crime”, Vietnam’s Foreign Ministry said. The move could help to repair the country’s frayed relations with the US.

Quan, a leading member of non-violent pro-democracy group Viet Tan, was arrested at Ho Chi Minh City’s airport after arriving on a flight from the United States. He went to Vietnam to teach non-violent resistance to the activists in the country, according to The Associated Press.

Authorities initially charged Quan with terrorism but that was later changed to subversion against the state, which carries penalties ranging from 12 years in prison to death.

He was also detained in Vietnam in 2007 for six months on charges relating to his pro-democracy activities.

The Communist government has cracked down on proponents of free speech and those who challenge the regime’s monopoly on power. Earlier this month, 14 Vietnamese activists associated with Viet Tan were each given sentences of up to 13 years in jail.

US officials condemned the lack of progress in addressing human rights issues in Vietnam, damaging relations between the two countries amid concerns over China’s emerging military and economic might in the region.