HONG KONG — An American graduate student who was arrested during a protest in Vietnam last month will be released and deported, a court announced on Friday, soon after the man went on trial for disrupting public order.

The student, Will Nguyen, had joined demonstrations against proposed special economic zones that protesters feared would result in Chinese control of Vietnamese territory.

Mr. Nguyen, a Yale graduate from Houston, had faced a possible prison term of up to seven years.

A court in Ho Chi Minh City ruled that because Mr. Nguyen was a foreigner and had expressed regret for his actions, he should be immediately deported, according to Vietnamese state media reports.

“Will is free!” Victoria Nguyen, Mr. Nguyen’s sister, said in a Twitter post. She had organized a campaign calling for his release.