Bangkok: A Thai opposition politician is facing up to five years in jail after he was charged on Thursday for criticising a senior general for making “sexist” remarks about ousted premier Yingluck Shinawatra.

Watana Muangsook, a prominent figure in the Pheu Thai party that was toppled by the 2014 army takeover, is being prosecuted under the country’s computer crimes law, which bans spreading false information digitally.

The charge relates to a Facebook post Watana wrote attacking the Thai junta’s deputy leader for saying that soldiers continued to photograph Yingluck, two years after she was toppled from office, because she is good looking.

“The soldiers took photos of Ms Yingluck probably because she is pretty,” General Prawit Wongsuwon told reporters. “It’s not a big deal. Don’t think too much about it or be anxious about it.”

In his post calling on the military to cease monitoring of Thailand’s first female prime minister, Watana said it was “unbelievable to hear such comments” by Prawit.

“They were sexist comments,” he added.

The junta reacted with fury to Watana’s post.

On Wednesday he was “invited to talk” with the military — the junta’s euphemism for a short period of compulsory detention.

However the authorities went a step further Thursday, charging him with breaching the Computer Crimes Act, a law that rights groups have long said is used by authorities to stamp out dissent.

“At 9.30pm (Wednesday) I was taken to Nang Loeng police station to acknowledge the charge of breaching Computer Crime Act BE 2550 (2007),” Watana posted on his Facebook page on Thursday.

“After finishing at the police station the army escorted me home at 11.10pm,” he said.

An official at Bangkok’s Southern Criminal Court confirmed the charge, which carries up to five years in jail, and told AFP Watana had been released on 100,000 baht (Dh10,284 or $2,800) bail.

Speaking after Watana was charged, former army chief turned Prime Minister General Prayut Chan-O-Cha said: “Don’t write headlines that the army arrested him. The army just invited him.”

“If he did not make criticisms we would not bother him,” he added.

Since seizing power in May 2014 the junta has crushed dissent, banning political discussion, locking up opponents and dramatically increasing prosecutions under laws covering lese majeste, sedition and computer crime.

General Prawit, officially the junta’s number two, is often described as Prime Minister Prayut’s mentor.

A former army chief and defence minister, military analysts refer to him as the “Big Brother” of the Eastern Tigers, a clique of powerful generals who oversaw both the 2014 and 2006 coups.

Prawit is not alone in making gaffes about women.

Prime Minister Prayut had to apologise in 2014 for comments suggesting beautiful foreign women wearing bikinis in Thailand should not expect to be safe, following the brutal rape and murder of a British backpacker.