BANGKOK: A Thai court on Wednesday jailed a former engineer for 27 years for planting a pipe bomb in an army-run hospital, a rare violent kickback against the junta which has ruled for over three years.

At least 21 people were injured — one seriously — when the nail-filled device detonated in the waiting room of King Mongkut hospital in Bangkok on May 22.

The date was the third anniversary of a coup that ousted the civilian government of prime minister Yingluck Shinawatra in 2014.

After his arrest Wattana Phumret, 62, confessed to planting the device in a vase due to what he has said was his “hatred for governments that come from military coups”.

The court ruling said the evidence “proved without doubt” the suspect’s guilt on several charges including attempted murder, but he avoided a life sentence due to his confession.

Politically-febrile Thailand has a history of gun and bomb attacks, often on anniversaries of military crackdowns and coups.

But Wattana’s apparent lone wolf plot was a rare display of revolt against the current military regime, which has successfully corralled its critics and consolidated its power.

Lost decade

The 2014 putsch marked the 12th successful coup in Thailand since 1932.

The army said it was forced to take power to end a deepening cycle of violence and instability that had gripped the country since 2006, when an earlier coup toppled Yingluck’s elder brother — Thaksin Shinawatra — as prime minister.

Bangkok’s streets became the stage for violent protests in the years between the two coups — dubbed Thailand’s “lost” decade.

The current junta — led by former army chief Prayut Chan-O-Cha, who is now prime minister — has met little resistance, with violent anti-government elements either jailed or in self-exile.

Elections are slated for late next year, but the timetable for a return to civilian government has repeatedly slipped.

Rights groups say the military uses the threat of political instability to prolong its rule.

The country remains broadly divided between the Shinawatra clan’s ‘Red Shirt’ supporters and a Bangkok-based elite with ties to the military.

Thaksin has lived in self-imposed exile in a Gulf state since 2008 to avoid graft convictions he says are politically motivated.

Yingluck fled Thailand in August to escape sentencing for alleged criminal negligence in a costly rice subsidy scheme.

A month later she was given a five-year jail sentence in absentia.