Sirens of ambulances and fire trucks wailed as the police chased and accosted the protesters. Some demonstrators burned Chinese flags and photographs of Mr. Xi. The police said some protesters attacked officers with a “corrosive fluid,” causing chemical burns, and threw gasoline bombs into a train compartment and onto a subway station platform.

In the end, more than 180 people were arrested, 25 officers were injured and 74 people were hospitalized including two in critical condition, the authorities said.

The Hong Kong police commissioner, Stephen Lo, told reporters at a midnight news conference that doctors were treating the 18-year-old who had been shot. Mr. Lo said the authorities would decide later whether to press charges against him for assaulting a police officer.

Mr. Lo also said the police officer who fired had acted in a “legal and reasonable” manner by giving a verbal warning beforehand, and that the officer had been forced to shoot after being assaulted at close quarters.

“The range was not determined by the police officer, but by the perpetrator,” he said.

But some Hong Kongers felt that the authorities were to blame for allowing the day to spiral into chaos.

In Wong Tai Sin, where the police fired tear gas near a retirement home, dozens of residents without masks or protest gear shouted at officers to retreat. Some mocked the city’s leader, Mrs. Lam, for having left town.

“I want to cry. I come downstairs and feel that I have walked into a war zone,” said Vincey Wu, a 53-year-old accountant. “Carrie Lam has gone off to celebrate National Day. But has she thought about her people who are breathing in tear gas?”