A Thai court has sentenced a high-profile royalist politician to two years in jail for insulting the monarchy - even though his offence was to publicly condemn anti-monarchy comments made by a political opponent.

Sondhi Limthongkul, a 65-year-old media mogul and founder of the royalist Yellow Shirt movement, was found guilty of lese majesté by a Bangkok appeals court for repeating the original insult.

"The accused had no reason to repeat comments made by a political rival in a public space as repeating them made those words known to an even wider audience," a judge said.

The court overturned a criminal court's acquittal based on the assumption that Sondhi was only urging prosecution for the original speaker.

King Bhumibol Adulyadej, 85, the world longest-reigning monarch, is a much revered figure in Thailand and his venerability is protected by the world's harshest lese majesté law, which carrys long jail sentences.

Sondhi, whose Yellow Shirt movement helped trigger a 2006 coup that ousted former prime minister Thaksin Shinawatra, was released on 500,000 baht (£10,000).

His legal troubles started in 2008 when he repeated remarks made by Daranee Charnchoengsilpakul, an outspoken supporter of Thaksin, dubbed as "Da Torpedo" for her aggressive speaking style.

At a protest rally against the 2006 coup, Daranee allegedly suggested that the monarchy had backed the military takeover.

She reportedly did not directly mention the king but allegedly made an allusive use of the words "yellow" and "blue", the traditional colours of the monarchy.

Daranee was jailed for 15 years.