Tens of thousands of Thai protesters cheered and chanted into the night in central Bangkok in a show of mass defiance to a ban on demonstrations designed to end more than three months of anti-government action.
As they dispersed at 10 pm on Thursday protesters pledged to return to the same place every day.
Growing demonstrations have targeted King Maha Vajiralongkorn as well as Prime Minister Prayuth Chan-ocha, a former junta leader, in the biggest challenge for years to an establishment long dominated by the army and palace.
"Like dogs cornered, we are fighting till our deaths," Panupong "Mike Rayong" Jadnok, one the high-profile protest leaders who remains free, told the crowd. "We won't fall back. We won't run away. We won't go anywhere."
Protesters ignored police appeals to disperse and spilled from the Ratchaprasong Intersection across streets and walkways, their mobile phones shimmering in the night. The location was the scene of bloodshed in 2010, during more than a decade of violence between supporters and opponents of the Thai establishment.
"All protesters will be prosecuted," the deputy head of Bangkok police, Piya Tawichai, told a news conference. "I would like us to warn the children and youth: participating in these protests could impact you in the future."
Police put the number of protesters at 10,000.
Protesters chanted for the release of some 40 activists arrested this week. Some also called out insults against the king - until recently almost unheard of behaviour in a country where the constitution says he must be revered.
Closing the protest, student leader Jutatip Sirikhan called on people to return at 5 pm on Friday and daily thereafter.
Three months of protests in the country of 70 million have been largely peaceful, as was a march by tens of thousands on Wednesday. But in one incident, police pushed jeering protesters away from a motorcade carrying Queen Suthida.
Overnight the government banned political gatherings of five or more people and the publication of news and online information that could threaten national security. Riot police swiftly cleared a protest camp outside Prayuth's office.
"The measures were necessary to ensure peace and order," government spokesman Anucha Burapachaisri said in a statement.
He rejected accusations from some government critics that the motorcade incident was an excuse to crack down.
Thai media reported that arrest warrants had been issued against two people for injuring the queen - which can carry a life sentence, whereas the maximum penalty for insulting the monarch under lese majeste laws is 15 years in jail.
Police said they had arrested protest leaders Parit "Penguin" Chiwarak and rights lawyer Arnon Nampa overnight. Student leader Panusaya "Rung" Sithijirawattanakul was taken away in a wheelchair.
Arnon said on Facebook he was taken to Chiang Mai, where he faces sedition charges over a speech in August. Panusaya and Parit also face sedition charges over comments at previous protests, their lawyer said. They all deny the charges.
In a handwritten note embellished with a rainbow, Panusaya urged protesters to keep fighting.
"You might all see leaders disappearing one by one, but we're actually always with you," she wrote.
The protest movement aims to remove Prayuth, saying he manipulated an election last year to keep hold of power. He says the election was fair.
Those marching on the streets also want a new constitution and have called for a reduction in the powers of the king. They want his role to be clearly subject to the constitution and seek the reversal of orders that gave him control of the palace fortune and some army units.
Anger in Thailand has been exacerbated by the economic impact of the coronavirus - even greater than in other parts of Southeast Asia because of the importance of tourism.
The Chinese government's top diplomat, State Councillor Wang Yi, agreed at a meeting with Prayuth on Thursday to speed up the transfer of people and goods and on future economic cooperation, Chinese state news agency Xinhua said.
The European Union, meanwhile, called on Thailand to respect the rights of detainees and urged restraint from all sides.