Democracy activists in Hong Kong have staged the biggest protest against a new national security law in months.
Hundreds of people gathered outside the court in which 47 fellow activists appeared on Monday to face charges of conspiracy to commit subversion.
Police told the crowds that they too were in breach of the controversial National Security Law.
China enacted the law last year, saying it is needed to bring stability. Critics say it has silenced dissent.
The law came into force after a series of mass pro-democracy protests in 2019, some of which turned violent.
The 47 pro-democracy activists appearing in court - 39 men and eight women, aged between 23 and 64 - were among a group of 55 people arrested in dawn raids last month.
They had helped run an unofficial "primary" election last June to pick opposition candidates for 2020 legislative elections, which the government then postponed.
Chinese and Hong Kong officials say the primary was an attempt to overthrow the government.
On Monday, police officers were deployed to control the crowds as pro-democracy supporters queued for seats at the court hearing.
Some chanted slogans including "liberate Hong Kong, revolution of our times" and "fight for freedom, stand with Hong Kong".
At the scene: Handwritten banners and warning flags
Grace Tsoi, BBC News, Hong Kong
Hundreds were queuing outside the West Kowloon Magistrates' Court before the hearing for the 47 pro-democracy activists - some came as early as last night.
Most of them wore black, the colour of choice by protesters in 2019. Banners filled with handwritten messages were displayed. The chanting of the slogan "liberate Hong Kong, revolution of our times" - which the government has said breaches the National Security Law - was occasionally heard.
Banners full of handwritten messages pic.twitter.com/cZG5nu8ynN— Grace Tsoi (@gracehw) March 1, 2021
Mr Chak, who is in his 50s, told me that he came to the court in the afternoon and knew that he wouldn't be able to go inside because of limited seating. But he wanted to show moral support to the activists.
Things got tense when police used coloured flags to warn the crowd about participating in an illegal assembly and possibly breaching the National Security Law.
But a few pro-Beijing supporters were also present, in a celebratory mood. One of their banners read: "Severely punish traitors and those who sell out the country, and all of them will be jailed after the National Security Law."
Police warned those gathered to split into groups of no more than four or face fines.
Those appearing at the court to face charges had been told on Sunday to report to police stations for detention ahead of the hearing.
Hong Kong police said in a statement: "Police this afternoon laid a charge against 47 persons... with one count of 'conspiracy to commit subversion'."
Who has been charged?
The 47 are some of the territory's best-known democracy campaigners.
They include veterans such as academic Benny Tai and politician Leung Kwok-hung, and younger protesters like Gwyneth Ho, Sam Cheung and Lester Shum.
Jimmy Sham, who leads a major non-violent protest group, remained defiant as he went to the police station.
"Democracy is never a gift from heaven. It must be earned by many with strong will," he said. "We will remain strong and fight for what we want."
Before turning herself in, Gwyneth Ho posted: "I hope everyone can find their road to peace of mind and then press forward with indomitable will."
Sam Cheung said: "I hope everyone won't give up on Hong Kong... fight on."
The charges carry a maximum term of life imprisonment. Bail is unlikely, with Benny Tai saying his chances were "not too great".
UK Foreign Secretary Dominic Raab said on Monday that the decision to bring charges against the 47 was a "deeply disturbing" step that violated the joint declaration Beijing reached with Britain when the former colony was handed back to China.
Amnesty International has described the January raids that detained the 55 as "the starkest demonstration yet of how the National Security Law has been weaponised to punish anyone who dares to challenge the establishment".
About 100 people have so far been arrested under the security law, including prominent China critic and media tycoon Jimmy Lai, who was denied bail and is in detention awaiting trial.
No trials have yet begun in full. The first is expected to be that of Tong Ying-kit, who is accused of riding a motorcycle into police officers last July. He appeared in court in November to enter a not guilty plea. He is expected to be tried by three judges rather than a jury.
What is in the National Security Law?
A former British colony, Hong Kong was handed back to China in 1997 but under the "one country, two systems" principle.
It was supposed to guarantee certain freedoms for the territory - including freedom of assembly and speech, an independent judiciary and some democratic rights - which mainland China does not have.
But the National Security Law has reduced Hong Kong's autonomy and made it easier to punish demonstrators.
The legislation introduced new crimes, including penalties of up to life in prison. Anyone found to have conspired with foreigners to provoke "hatred" of the Chinese government or the Hong Kong authorities may have committed a crime.
Trials can be held in secret and without a jury, and cases can be taken over by the mainland authorities. Mainland security personnel can legally operate in Hong Kong with impunity.
After the law was introduced, a number of pro-democracy groups disbanded out of fears for their safety.