By Jonathan Head
BBC News, Bangkok
Watching one of the most illustrious gatherings of Asian leaders you are ever likely to see in your country being airlifted from the hotel you have been hosting them in must be a pretty humiliating experience.
Protesters vented their fury on a car they thought had the PM inside
So all eyes were on Thai Prime Minister Abhisit Vejjajiva the morning after to see how he would respond to the embarrassment heaped on him by the red-shirted protestors from the UDD, who had stormed the summit venue in Pattaya and brought it to a premature and chaotic halt.
He did not mince his words. Anyone who can call the events in Pattaya a victory, he said, should be branded an enemy of the state.
He vowed to have those responsible for the storming of the summit arrested - almost immediately news came in that the most prominent leader had been taken from his home by police.
Shortly afterwards all Thai television stations were interrupted by a broadcast announcing that a state of emergency was being imposed in Bangkok and surrounding provinces.
Mr Abhisit then appeared again to explain that he was determined to restore the rule of law. Under the decree gatherings of more than five people are banned. The army can be deployed, and use force to drive people from the streets.
As in Pattaya, it has not panned out the way the prime minister had hoped. Almost as he was speaking - from the interior ministry, as his own offices are still blockaded by the UDD - a group of protesters were confronting the guards outside the ministry.
Is the army divided, or just afraid to act?
They disarmed one, then vented their fury on a limousine they believed was carrying Mr Abhisit, hurling pot-plants, furniture, branches torn from trees, anything they could lay their hands on, at the car, leaving it dented.
Later they inflicted a terrible beating on two of the prime minister's staff - they were only driven off when the guards fired shots in the air.
Even when the army finally appeared, events still were not going Mr Abhisit's way. As they drew up outside one of Bangkok's ritziest shopping malls, they were mobbed by red-shirts, who climbed up onto their armoured personnel carriers and greeted the soldiers like long-lost friends.
Any notion that the army would be quickly dispersing the crowd evaporated at that point.
Elsewhere the protesters had the run of the city. They commandeered buses, blocking major intersections and the main intercity railway line out of Bangkok.
Their leaders announced that, with the state of emergency, the rule of law had ceased to exist, so they should feel free to attack the government at will.
The only area where there was a visible military presence was around the royal palace, although King Bhumibol rarely stays there these days.
As dusk fell, the UDD crowds received a phone call from the exiled former Prime Minister, Thaksin Shinawatra.
Maybe the army will stick to its habitual inaction, the prime minister will keep a grip on his job, and Thailand will keep stumbling on, as it has through the past three, strange, chaotic years
Now is a "golden time" to rise up against the government, he told them. He called for a revolution, which, he said, he was ready to come back and lead.
Mr Thaksin's soaring rhetoric does not quite match the reality on the ground here. There are perhaps 20-30,000 protesters around Bangkok, although their numbers could swell - the UDD is not short of sympathisers in this city.
But a mass uprising? Most of Bangkok's residents probably just wish this debilitating political stand-off would end.
However, the lack of action by the army must be worrying Mr Abhisit.
At one point his deputy, Suthep Thaugsuban, the veteran politician who really pulls the strings in the prime minister's party, pleaded with the security forces to act, promising the government would take responsibility for any bloodshed.
At the time of writing that appeal has still gone unanswered.
Fears for reputation
Spokesmen for the red-shirts say this is because the army is divided over what to do. They are convinced they have enough sympathisers in the ranks to make the commanders think twice before taking forceful action.
The next 24 hours are crucial for Mr Abhisit
Other commentators think the army worries about its reputation with the public, and fears being blamed for any violence, whatever Mr Suthep may promise.
Or that commanders believe the deep splits in Thai society cannot be resolved through military intervention.
Or that they recognise the hypocrisy of moving against the red-shirted crowds, when they refused to move against the rival yellow-shirted crowds that paralysed the governments of Mr Thaksin's allies last year.
The next 24 hours should be decisive. Mr Abhisit has more or less staked his authority as prime minister on clearing the protesters from Bangkok. The UDD appears to see this as a final showdown with a government it still argues has no legitimacy.
But it is quite possible there will be no decisive moment. Maybe the army will stick to its habitual inaction, the prime minister will keep a grip on his job, and Thailand will keep stumbling on, as it has through the past three, strange, chaotic years.