SPEAKING your mind can be costly in Vietnam. This week a court in Ho Chi Minh City, the main city in the south of the country, sentenced four democracy activists to jail terms ranging from five to 16 years. Two of the men, Le Cong Dinh and Nguyen Tien Trung, had previously studied and lived abroad and one, Mr Dinh, is among the country's best-known criminal defence lawyers.

Their “crimes” were little more than daring to express frank opinions about the state of political freedom in the country and, in the case of Mr Dinh, having defended human-rights activists who had been detained following a brief wave of political openness in 2006.

Mr Trung had made the mistake of responding to a public call in 2006 by Vietnam's education minister, who asked for ideas for improving the country's woefully inadequate public schooling system. Mr Trung, who lived abroad at the time, wrote him a letter and, when he got no answer, naively published it on his blog. Soon police visited his family and friends in Vietnam, asking about his political views. Infuriated, Mr Trung and other Vietnamese students abroad launched a website, “Vietnamese Youth for Democracy”.

The site became popular in Vietnam and attracted the attention of the anti-communist Vietnamese diaspora. Mr Trung then met Canada's prime minister, Stephen Harper, various American congressmen and even, briefly, in 2006 the then American president, George Bush. When he moved back to Vietnam he fell in with a group of activists who were supported by Vietnamese exiles in California. The group strove to revive a defunct political party. Mr Trung led its youth wing.

Mr Dinh developed contacts with another American-based exile group, Viet Tan, which seeks a non-violent move to multi-party democracy. Vietnam's government calls it a terrorist group. In March 2009 Mr Dinh attended a workshop on non-violent protest that Viet Tan had organised in Thailand.

Last year the authorities detained Mr Dinh and Mr Trung along with two internet entrepreneurs who had posted political articles online and dared to organise a political discussion group. In August all four read out confessions on national television and then were charged with conspiring to overthrow the government. Two of the men later recanted the confessions during a trial, saying they had been coerced into making them. One of them, Tran Huynh Duy Thuc, was handed a 16-year sentence as punishment.

Mr Dinh got off more lightly because he admitted in his trial to being “influenced by Western ideas”. He acknowledged that he had broken Vietnamese law, because the constitution reserves the leading role in state and society for the Communist Party, so support for a different political party is illegal.

It is not clear why Vietnam's government has embarked on the latest repression of bloggers, activists, religious groups and others. It may be that the authorities are anxious about the forthcoming 11th Party Congress and a struggle between pro-Chinese and pro-Western factions in the Politburo could have provoked a crackdown. Political openness comes and goes, but smart young Vietnamese, especially those who have ventured abroad, are becoming increasingly frustrated by a stifling system.