A Thai court has sentenced six anti-government protest leaders to two years in jail for storming the prime minister's office during a 2008 rally.

Thousands of Yellow Shirt protesters from the royalist People's Alliance for Democracy (PAD) held protests in 2006 that helped undermine then-prime minister Thaksin Shinawatra.

The protracted rallies lead to Mr Thaksin's overthrow later that year.

The group brought much of Bangkok to a standstill in 2008 when protesters blockaded key government offices and the city's airports in an eventually successful bid to remove a Thaksin ally, Somchai Wongsuwat, from the office of prime minister.

In passing sentence, the court dismissed the defence's argument that protesters were unarmed and added that "the storming of Government House affected the rights of others".

"The court finds that going in Government House impacted the freedom of others and was not a peaceful protest according to the constitution," a criminal court judge said.

Yellow Shirt founder Sonthi Limthongkul was among the six given three-year jail sentences, reduced to two years.

A lawyer for the group said they were released on bail pending an appeal but were banned from travelling overseas.

Sonthi, a former media tycoon, has faced a slew of convictions and other legal challenges, many connected to his prominent role in Thailand's politics.

The success of the Yellow Shirts and their royalist supporters among the establishment prompted the emergence of the rival Red Shirt street movement supporting Mr Thaksin, who went into self-exile in 2008.

The once-influential, pro-establishment PAD has played a reduced role in Thailand's politics in recent years but many of its members took part in protests in Bangkok last year that helped lead to the removal of Thaksin's sister, Yingluck, as prime minister.

The protests culminated in a coup by the army last May. The leaders of the latest protests are yet to face legal action.

AFP/Reuters