Two former Thai prime ministers have been cleared of abuse of power in a case involving an anti-government protest in 2008 that turned deadly.

Thailand's highest court in Bangkok on Wednesday acquitted Somchai Wongsawat, his then deputy Chavalit Yongchaiyudh and two former police officials.

They had been accused of authorising the police to use force against protesters who had blockaded the National Assembly building. A pitched battle ensued, injuring several hundred people and causing two deaths.

A judge said the court could not conclude that the injuries protesters sustained were from police weapons and grenades, according to the AP news agency.

Thaksin's brother-in-law

Somchai is the brother-in-law of another former prime minister, Thaksin Shinawatra, whose removal in a 2006 coup triggered sometimes violent battles for political power in Thailand.

Thaksin's supporters see the various criminal cases against him and his allies as attempts to erase his influence from Thai political life.

Somchai thanked the court after its verdict and said he was grateful there was still justice in the country. Chavalit - who served as premier in the 1990s - did not comment. They could have faced up to 10 years in prison if they had been convicted.

The ruling, however, angered a small group of protesters outside the court, some of them participants in the October 2008 protest.

One woman shouted: "Let them all get terrible diseases that can't be cured and die painful deaths!" as Somchai walked away.

In a separate trial, Thaksin's sister, former Prime Minister Yingluck Shinawatra, declared her innocence and asked for "kindness" from the court that will decide whether she mishandled a rice subsidy programme that allegedly lost billions of dollars.

Her bank account has already been frozen after an administrative court held her responsible for some of the losses. The verdict in Yingluck's case is to be issued on August 25.

Thaksin has been in self-imposed exile since 2008 to escape a prison sentence on a conflict of interest conviction.