PHNOM PENH, Cambodia — A Cambodian court on Monday sentenced an opposition lawmaker who has been a strong critic of the government’s handling of demarcating the border with neighboring Vietnam to 2 1/2 years in prison for online postings he made.

Um Sam An is the latest member of the opposition Cambodia National Rescue Party to be sentenced for making comments on the politically sensitive topic and implying that Prime Minister Hun Sen’s government failed to counter land encroachment by Vietnam, Cambodia’s traditional enemy.

In handing out the sentence, Judge Heng Sokna of the Phnom Penh Municipal Court said the accusations made by Um Sam An in Facebook posts last year aimed to cause chaos in society.

The lawmaker was arrested in April in the Cambodian city of Siem Reap after having returned from a trip to the United States.

A month ago, the same court sentenced Kem Sokha, deputy to the opposition party’s leader, to five months in prison for twice ignoring a summons to answer questions related to a case involving his alleged mistress.

Critics say Hun Sen is manipulating the courts to weaken the opposition’s chances in next year’s local polls and the 2018 general election. The opposition made an unexpectedly strong showing in the 2013 general election, which it claimed it was cheated out of winning.

One victim of the legal moves has been opposition leader Sam Rainsy, who did not return from a trip abroad last November when an old conviction for defamation was restored and his parliamentary immunity was stripped by the government’s legislative majority. It had been generally assumed that the conviction, carrying a two-year prison sentence, had been lifted by a 2013 pardon that allowed Sam Rainsy to return from a previous period of self-exile.

Monday’s conviction of Um Sam An came after the opposition unexpectedly failed to attend the reopening of parliament on Friday, setting back hopes of a political truce with the government.

The party stopped attending parliamentary sessions about four months ago after ruling party lawmakers stripped some opposition lawmakers of their legal immunity. The opposition says lawsuits have been used to unfairly harass its members.

Hun Sen has been Cambodia’s leader for three decades. But in a general election in 2013, it seemed his grip on power was shaken when the Cambodia National Rescue Party mounted a strong challenge, winning 55 seats in the National Assembly and leaving Hun Sen’s Cambodian People’s Party with 68. The opposition claimed it had been cheated and staged a boycott of parliament. Seeking to shore up his legitimacy, Hun Sen reached a political truce with the opposition in 2014, making some minor concessions over electoral and parliamentary procedures.

But relations deteriorated last year after the opposition tried to exploit a volatile issue by accusing neighboring Vietnam, with which Hun Sen’s government maintains good relations, of land encroachment. The move proved politically popular, and the government reacted by stepping up intimidation of the opposition party in the courts, which are seen as being under its influence.

Hun Sen’s party has often been accused in the past of using violence or the threat of violence against opponents, but in recent years has stalked its foes mostly in the courts.