A young activist was sent to a rehabilitation centre for biting a police officer during the annual July 1 march last year.
Magistrate Symon Wong Yu-wing rejected 21-year-old Yim Man-wa's request for bail. Her lawyer, Jasper Kwan, said his client would appeal against her conviction and sentence.
Yim's length of stay at the centre depends on evaluation reports about her behaviour.
The court earlier heard the League of Social Democrats member assaulted policewoman Wong Sau-ying, 38, biting her left arm when Wong and three other officers were removing her from Causeway Road at 4.30pm.
Yim, who has no previous conviction, had earlier pleaded not guilty at Eastern Court to one count of assaulting a police officer. She was remanded in custody for 21 days.
Kwan put forward a suggestion that the bite was an accident which occurred amid chaotic circumstances.
Medical doctor Chau Yau-ming, a prosecution witness, dismissed that claim, saying the bite was oval in shape, which could not be caused by light contact.
Kwan said Yim was a well-behaved person who displayed independent thinking and took part in events out of a sense of duty to uphold social justice.
The defence said that on the day of the incident, the area was very crowded. Yim, who was fired up over the police's crowd control arrangements, was trying to find a way to let fellow protesters leave Victoria Park in Causeway Bay quickly.
Kwan also said Yim was willing to ensure her participation in future social activities would be peaceful.
Outside court, lawmaker "Long Hair" Leung Kwok-hung said it was unreasonable for the magistrate to send Yim to the rehabilitation centre, given she had expressed her intention to launch an appeal, which meant it was possible a judge might acquit her later.
He said Yim's parents would find a lawyer to help her apply for bail.
James Hon Lin-shan, a retired teacher who took part in a hunger strike against national education last year, said outside court: "It was normal for clashes to take place in circumstances where police failed to arrange a suitable rally route."
He accused the police of selectively laying charges against league members.