Thailand's government declared a strict new state of emergency for the capital, a day after a student-led protest against the country's traditional establishment saw an extraordinary moment in which demonstrators heckled a royal motorcade.
After the pre-dawn declaration, riot police moved in to clear out demonstrators who after a day of rallies and confrontation had gathered outside prime minister Prayuth Chan-ocha's office to push their demands, which include the former general stepping down, constitutional changes and reform of the monarchy.
Several top leaders of the protest movement were taken into custody, with one later declaring on his Facebook page that he had been denied access to a lawyer and was being forced onto a helicopter and taken to a city in the country's north.
Police said they had made 22 arrests.
Despite a new ban against large public gatherings, several thousand people answered calls to rally again in another area of the city later on Thursday.
The text of the emergency declaration said it was needed because "certain groups of perpetrators intended to instigate an untoward incident and movement in the Bangkok area by way of various methods and via different channels, including causing obstruction to the royal motorcade".
The protest on Wednesday in Bangkok's historic district, not far from glittering temples and royal palaces, was the third major gathering by student-led activists who have been pushing the boundaries of what is considered acceptable, and legal, language by publicly questioning the role of Thailand's monarchy in the nation's power structure.
Thailand's royal family has long been considered sacrosanct and a pillar of Thai identity.
King Maha Vajiralongkorn and other key member of the royal family are protected by a lese majeste law that has regularly been used to silence critics who risk up to 15 years in prison if deemed to have insulted the institution.
The protest, held on the anniversary of a 1973 student-led uprising against a military dictatorship, was complicated by the presence of royalist counter protesters who had gathered both to show support for the government and to greet the royal family as they travelled to and from a religious ceremony in the area.
That led to a moment captured in photos and video that circulated widely on social media in which what appeared to be protesters gestured and shouted just feet from the royal motorcade.
Such actions are unprecedented in Thailand, where those waiting for a royal motorcade regularly sit on the ground or prostrate themselves.
Some experts say a line may have been crossed.
"What seemed to be a low-boil stalemate that the Prayuth government was managing with reasonable success has now, following the incident involving the procession of the queen's motorcade down a street in which an active protest was under way and the arrests of protest leaders, become a full-blown crisis," said Michael Montesano, coordinator of the Thailand Studies Programme at the Iseas-Yusof Isak Institute in Singapore.
"Unlike even 48 hours ago, the country is in dangerous territory now."
Government spokesman Anucha Buraphachaisri announced on Thursday morning that the prime minister had ordered police to take strict action against those who obstruct a royal procession or otherwise insult the monarchy.
One change is that police said they will install checkpoints around Bangkok for security purposes.
Keeping order will be facilitated by the new emergency decree for Bangkok, which bans unauthorised gatherings of more than five people and gives authorities other powers they deem needed to prevent unrest, including detaining people temporarily without charge.
It also outlaws news that distorts information or could cause a "misunderstanding".
Thailand is already under a national state of emergency as part of its efforts to fight coronavirus, and it was not immediately clear how the new decree was different.
Protesters gathered again in a Bangkok shopping district on Thursday afternoon and into the evening.
The crowd grew big enough to block a major intersection flanked by upmarket malls and a famous shrine, where they were addressed by a series of speakers denouncing the government.
Police stood by while the crowd chanted rude slogans calling for the prime minister to step down.
They also chanted "Free our friends", in reference to the arrested leaders.
"I want to fight for my future. I want to fight for my friends. I want to fight for my democracy. My country must be democracy," said 24-year-old NGO worker Aitarnik Chitwiset.