A Thai court has ordered Prime Minister Yingluck Shinawatra and several cabinet ministers to step down.
The Constitutional Court ruled that Ms Yingluck acted illegally when she transferred her national security head.
The ruling follows months of political deadlock. Anti-government protesters have been trying to oust Ms Yingluck since November 2013.
The remaining cabinet members have nominated the commerce minister to replace Ms Yingluck.
The judges gave a lengthy justification for their verdict, but it will inevitably be seen as political intervention by people on both sides of Thailand's divide. The government's supporters had already stated they would view the verdict as a judicial coup, and reason enough to mobilise against it.
There was, predictably, jubilation in the camps of the anti-government protesters in Bangkok. But they did not get everything they wanted.
The judges stopped short of holding the entire cabinet responsible for transferring the national security adviser. Only nine ministers, directly involved in approving the transfer, have been ordered to resign. So the cabinet survives, although still only in a caretaker role, until another general election can be held.
The government wants that on 20 July. But the opposition Democrat party is likely to repeat its boycott, and the protesters it now allies itself to are sure to obstruct it.
Nor are the government's many powerful opponents likely to give up trying to depose it. There are more legal cases pending against ministers, and the partly-appointed Senate is still sitting, and may explore other means of disabling Ms Yingluck's party.
"The cabinet has agreed to appoint Niwattumrong Boonsongpaisan to act as caretaker prime minister," Deputy Prime Minister Phongthep Thepkanjana said. READ MORE ON BBC ONLINE