Tep Vanny, one of the country’s most prominent rights activists, was sentenced to two and a half years in prison on Thursday over charges related to a protest outside Prime Minister Hun Sen’s Phnom Penh mansion in 2013.

The decision is the latest in what is widely seen as a government offensive against critics, from activists and human rights defenders to political analysts and opposition officials. Ms. Vanny is among at least 25 political prisoners in the country, according to rights group Licadho.

Presiding Judge Long Kesphirum readout the decision against Ms. Vanny as her supporters and state security guards clashed outside the courtroom.

“The Phnom Penh Municipal Court decided to sentence defendant Tep Vanny to two years and six months in prison and fine 5 million riel [about $1,250] to the state budget,” he said.

Ms. Vanny was also ordered to compensate two state security guards, Hor Hoeun and Uk Rotana, 4 million riel (about $1,000) and 5 million riel (about $1,250) in compensation, respectively.

The activist claims that it was the security guards who attacked the protesters during the demonstration, in which 30 residents of the capital’s eviction-hit Boeng Kak neighborhood attempted to deliver a petition seeking the release of fellow activist Yorm Bopha.

When Mr. Hoeun entered the courtroom during a hearing earlier this month, Ms. Vanny lashed out at him.

“Oh, he is a plaintiff? How are you so fat yet would let women beat you?” Ms. Vanny shouted at him. “I am feeling bad when the plaintiff is the person who beat us while we protested for nearly 10 years.”

After Thursday’s decision was announced, Ms. Vanny and her supporters in the courtroom repeatedly shouted: “This is an injustice.”