A court dissolved Thailand's top three ruling parties for electoral fraud Tuesday and temporarily banned the prime minister from politics, bringing down a government that has faced months of strident protests seeking its ouster.

The Constitutional Court ruling set the stage for thousands of protesters to end their weeklong siege of the country's two main airports, but also raised fears of retaliatory violence by a pro-government group that could sink the country deeper into crisis and cripple its economy.

Members of the People's Alliance for Democracy, occupying Bangkok's Suvarnabhumi international airport, cheered and hugged after they heard news of the verdict.

"My heart is happy. My friends are very happy," said Pailin Jampapong, a 41-year-old Bangkok housekeeper choking back tears as she jumped up and down.

Government spokesman Nattawut Sai-kau said Prime Minister Somchai Wongsawat and his six-party ruling coalition would step down.

"We will abide by the law. The coalition parties will meet together to plan for its next move soon," he told The Associated Press.

He also said the government was postponing a regional summit in Thailand of Southeast Asian countries, from December to March.

Somchai had become increasingly isolated in recent weeks. Neither the army, a key player in Thai politics, nor the country's much revered king had offered him firm backing. Since Wednesday, he and his Cabinet had been working out of the northern city of Chiang Mai, a government stronghold.

Somchai accepted the ruling with equanimity.

"It is not a problem. I was not working for myself. Now I will be a full-time citizen," he told reporters in Chiang Mai.

Somchai's People's Power Party, the Machima Thipatai party and the Chart Thai party were found guilty of committing fraud in the December 2007 elections that brought the coalition to power with a thumping majority.

Court President Chat Chalavorn said the court was dissolving the parties "to set a political standard and an example."

"Dishonest political parties undermine Thailand's democratic system," he said in the court's ruling.

The ruling sends Somchai and 59 executives of the three parties into political exile, barring them from politics for five years. Of the 59 members, 24 are lawmakers who will also have to resign their parliament seats.

But other lawmakers that escaped the ban can join other parties and try to cobble together a new coalition and choose a new prime minister.

Until then, Deputy Prime Minister Chaowarat Chandeerakul will become the caretaker prime minister, said Suparak Nakboonnam, a government spokeswoman. She said parliament will have to pick a new prime minister within 30 days.

Despite the appearance of a smooth political transition, the ruling is expected to widen the dangerous rift in Thai society that many fear could lead to violence between pro- and anti-government groups.

Hundreds of Somchai's supporters gathered outside the court to express their anger, saying the swiftness of the ruling — the closing arguments ended earlier Tuesday — reeked of predetermination. At one point they cut off the power supply to the court, but electricity was restored with diesel generators.

"The court is not qualified to make this ruling. They are nothing more than apologists for the alliance, who are ruining the country," said a speaker, shouting through a megaphone.

Late Monday, an explosive device fired from an elevated highway fell among hundreds of protesters inside Don Muang airport, killing one person and wounding 22.

It was the third such attack in two days by unidentified assailants targeting the protesters. So far, seven people have been killed and scores injured in bomb attacks, clashes with police and street battles between government opponents and supporters.

Despite the ruling, the protest alliance told its members to stay put at Suvarnabhumi and Don Muang domestic airports for now.

Top leaders of the alliance would meet later Tuesday to decide the next course of action, said Sirichai Maingam, an alliance leader.

Up to 10,000 alliance members have taken over the two airports, cutting off all commercial traffic to the capital, stranding more than 300,000 foreign travelers and bleeding millions of dollars from the country's economy in lost business and tourism.

At Suvarnabhumi airport, the verdict was read out on a protest stage outside the main terminal, triggering cheers and loud roars of jubilation.

It is "good for Thailand. This is a blow for corruption," Nong Sugrawut, a 55-year-old businessman at Suvarnabhumi.

With Suvarnabhumi and Don Muang closed, stranded travelers are being flown out of provincial airports with limited passenger capacity or are making their way overland to neighboring Malaysia.

Even if the protesters disperse, officials say it will take at least another week before the airports become operational again.

Standard & Poor's revised the credit rating outlook for Bangkok Bank, the country's biggest, from stable to negative. It issued similar downgrades for seven other major enterprises and for Thailand in general.

The protesters accuse Somchai of being a proxy of ousted Prime Minister Thaksin Shinawatra, the alliance's original target. Thaksin, who is Somchai's brother-in-law, was deposed in a 2006 military coup and has fled the country to escape corruption charges.

Chokchuang Chutinapon, a 64-year-old retired medical doctor from Bangkok, said the verdict "is wonderful for PAD."

"It is a victory for the entire nation, a victory over the corrupt and dictatorial Thaksin regime and ... Somchai who is the puppet of Mr. Thaksin," he said.

Alliance supporters are largely middle-class citizens who say Thailand's electoral system is susceptible to vote-buying and argue that the rural majority — the Thaksin camp's political base — is not sophisticated enough to cast ballots responsibly.

They have proposed discarding direct elections in favor of appointing most legislators, fostering resentment among rural voters.