A Thai court has sentenced six prominent anti-government protest leaders to two years in prison for storming the prime minister's office compound seven years ago.

A Criminal Court judge says former media mogul Sondhi Limthongkul and five other leaders of the People's Alliance for Democracy were guilty of trespassing at the Government House during a 2008 rally.

Thousands of protesters, also known as the Yellow Shirts, took over the premier's office and occupied the grounds for weeks, calling for the prime minister to quit.

The protest leaders also led a two-week seizure of Bangkok airports, but have not been charged for that.

The court says it reduced the leaders' original sentence of three years' imprisonment because of the defendants' cooperation.