Yolanda Yu, a spokeswoman for the Hong Kong Police Force, said in a video posted on the force’s Facebook page that the protester was an 18-year-old who had been shot in the left shoulder. She said the protester was conscious as he was taken to the hospital.

Local news media reported that the young man was a high school student.

Ms. Yu said the officer who shot the protester had been under attack by violent “rioters” who were threatening officers’ lives. “In order to save himself and his colleagues, he fired one shot at the attacker,” she said.

In the video, the protester who was shot is first seen joining a black-clad mob of people who chase a riot officer and tackle him to the ground. They kick him and beat him with what appear to be metal pipes.

At one point, the protester approaches a second police officer who is standing nearby with a handgun drawn. Just after the protester hits the officer with the pipe, the officer fires at the man at point-blank range.

Stephen Lo, the Hong Kong police commissioner, told reporters at a late-night news conference that doctors were treating the 18-year-old who had been shot. He said the protester had been arrested and that the authorities would decide later whether to press charges of assaulting a police officer.