BANGKOK — Thailand’s prime minister was ordered by a court to step down Wednesday in a divisive ruling that handed a victory to anti-government protesters who have staged six months of street protests — but does little to resolve the country’s political crisis.
The Constitutional Court found Prime Minister Yingluck Shinawatra guilty of abusing her power by transferring a senior civil servant in 2011 to another position. It ruled that the transfer was carried out to benefit her politically powerful family and, therefore, violated the constitution — an accusation she has denied.
The ruling also forced out nine Cabinet members but left nearly two dozen other ministers in their posts, including Deputy Prime Minister Niwattumrong Boonsongpaisan, who was quickly appointed the new acting leader.
‘‘Transferring government officials must be done in accordance with moral principle,’’ the court said in its ruling, read aloud on live television for almost 90 minutes. ‘‘Transferring with a hidden agenda is not acceptable.’’
Smiling and looking relaxed, Yingluck appeared live on national television two hours after the verdict to thank her supporters, emphasize that she was an elected leader and assert her innocence.
‘‘We held true to the principles of honesty in running the country, and never acted corruptly, as we were accused,’’ said Yingluck, 46, who swept to power nearly three years ago as the country’s first female prime minister.
The judgment marks the latest dramatic twist in Thailand’s long-running political crisis. It was a victory for Yingluck’s opponents, mostly from the urban elite and those in the south, who have been engaged in vociferous and sometimes violent street protests demanding she step down to make way for an interim unelected leader.
However, the ruling leaves the country in political limbo and primed for more violence. Since November, more than 20 have been killed and hundreds injured in sporadic gun-battles, drive-by shootings and grenade attacks.
The court’s decision casts doubt on whether new elections planned for July will take place, which would anger Yingluck’s mostly rural supporters who have called for a major rally Saturday in Bangkok.
‘‘Today’s verdict is just a bump on the road of democracy, but we will still keep moving on,’’ said Jatuporn Prompan, leader of the pro-Yingluck Red Shirt protest movement. ‘‘Our stance has been clear ... if an illegal prime minister steps in, we will fight. If there’s a coup, we will fight.’’
It also remains far from clear whether her opponents will be able to achieve other key demands, including creating a reform council overseen by a leader of their choice that will carry out various steps to rid the country of corruption and what they claim is money politics, including alleged vote-buying.
Yingluck and her Pheu Thai party remain very popular among the country’s poor majority, particularly in the north and northeast. But she is despised by Bangkok’s middle and upper class as a puppet of her brother, Thaksin Shinawatra, a former prime minister and polarizing figure.
Thailand’s political upheaval began in 2006 when Thaksin was ousted in a military coup after protests accusing him of corruption, abuse of power and disrespect for constitutional monarch King Bhumibol Adulyadej.
Thaksin’s supporters say the Thai establishment opposes him because their position of privilege has been threatened by his electoral popularity, cemented by populist programs that benefited the less well-off in the countryside.
Thailand’s courts, like its military, are seen as bastions of anti-Thaksin conservatism, and have a record of hostile rulings toward the Shinawatra political machine, which is fueled by a fortune Thaksin made in the telecommunications sector. Thaksin’s opponents, including those who have rioted and attacked police, destroyed public property and occupied government offices, have usually been treated leniently by the courts.
Analysts called the decision a damaging one for Thailand’s judicial system.
‘‘The credibility of the justice system has vaporized,’’ said Thongchai Winichakul, a professor of Southeast Asian history at the University of Wisconsin. ‘‘The royalist conservatives may celebrate this judicial coup. But the world will mourn over the death of another democracy.’’
In 2007, the Constitutional Court made a landmark ruling dissolving Thaksin’s original Thai Rak Thai party for fraud in a 2006 election, and banned its executives from politics for five years. Thaksin went into self-imposed exile in 2008 to escape a two-year jail sentence for conflict of interest while prime minister.
Thaksin’s allies in late 2007 handily won the first post-coup election, but the Constitutional Court in 2008 kicked out two successive pro-Thaksin prime ministers.
A coalition government then cobbled together by the opposition Democrat Party had to use the army to put down pro-Thaksin demonstrations in 2010 that left more than 90 people dead in street battles, but Yingluck and her Pheu Thai party won a sweeping majority in a mid-2011 general election.
Yingluck’s fortunes plunged when her party’s lawmakers late last year used shady legislative tactics to try to ram through a law that would have given an amnesty to political offenders of the previous eight years, including Thaksin. The move reignited mass anti-government demonstrations.
Seeking to ease the pressure, Yingluck in December dissolved the lower House and called elections for Feb. 2. But her opponents on the street disrupted the polls, which in turn were invalidated by the courts.
Associated Press writers Grant Peck and Jocelyn Gecker contributed to this report.