BANGKOK - The General made his first move as Bangkok slept.
At 3am on Tuesday, May 20, the notice went out: Martial law across the country.
Within minutes, armed soldiers surrounded TV stations. Jeeps with light machine guns screeched to a halt at the police headquarters and key intersections in downtown Bangkok. The army took over security around two sprawling rival protest camps, one downtown, the other at the city's western edge.
The soldiers were polite, but protesters were ordered to stay where they were.
It was the first act of a script written months earlier. But Act Two came as a bigger shock.
The next day, leaders from all the political factions were summoned to the Army Club in old Bangkok. Some looked meek, some apprehensive, some confident. Some took selfies. Adversaries who had slammed each other on stage almost nightly for months joked with one another.
Army officers registered them and ushered them up red carpeted stairs into a large conference room. Army chief General Prayuth Chan-ocha came in last and took his place as chair.
"It is a bit funny - that was the first time all the different parties got together in one room and it went pretty much peacefully. It was quite calm," recalled Mr Akanath Promphan, the Oxford-educated spokesman for the People's Democratic Reform Committee (PDRC), which was trying to drive the government out of office.
At the end of that first day of talks, there was no agreement. The General sent everyone home with the admonishment to "think about it".
The second day wasn't so funny. Mobile phones were banned from the room. More heavily armed soldiers stood guard outside. Gen Prayuth had all the key people right where he wanted them.
"What I'm doing today is in the interest of security," he said, to open the meeting. "If this steps over anyone, then I have to apologise."
In the end, it came to this: The Democrat Party and PDRC insisted that the caretaker government move aside for an interim appointed administration that would institute widespread reforms before an election. The government insisted that was unconstitutional, and demanded an election first.
PDRC leader Suthep Thaugsuban asked for private talks with Mr Jatuporn Promphan, chair of the pro-government "red shirt" umbrella group, the United Front for Democracy against Dictatorship (UDD). The two men spoke for about 45 minutes, before whispering to Gen Prayuth in a corner.
At around 4.40pm, the meeting reconvened. The General asked Justice Minister Chaikasem Nitisiri if the caretaker government insisted on staying put. The reply: "We will not resign."
Then the General said: "Okay, then from this minute I decide to seize power. Election Commissioners and Senators, please leave the room."
Some thought it was a joke - until Gen Prayuth, who was heading towards the door, turned back and said: "Stay here."
Seconds later, more than 30 soldiers poured into the room, one armed escort assigned to each participant, Democrat Party deputy secretary-general Sirichok Sopha told The Sunday Times.
Cabinet members were escorted out of the room first, followed by UDD and PDRC representatives, he said. They would be detained in military camps outside of Bangkok for up to a week.
Members of the two political parties were held in the meeting room until nightfall, then transferred to a military camp.
Outside the conference room, nobody had any idea what had happened. Journalists, and their army minders, just saw a grim-looking Gen Prayuth emerge, get into a black Mercedes-Benz and leave in a motorcade.
Then two army trucks appeared and, with engines revving, blocked the club entrances. Troops crouched by the vehicles, guns ready. A stream of minivans left under heavy armed escort. In them were the detainees.
Across town, troops surrounding the PDRC and UDD protest sites instantly changed their attitude. Buses rolled up. Soldiers moved swiftly to disperse the rallies and send people back to their home provinces.
At the "red shirt" rally, eyewitnesses said, soldiers fired in the air as they advanced. In videos, shots are clearly audible as red shirt leaders at the main stage duck and run. They were arrested within minutes.