A police spokesman said three men including Mr. Ho were injured in the attack. All three men were conscious when sent to the hospital, the spokesman said, and the attacker had been placed under arrest. The attacker appeared to have had a knife, the police said, but indicated the investigation was still ongoing. No details about the identity of the attacker or the third injured person were released.

The speed with which the attacker was subdued and a well-positioned camera that recorded the incident prompted some speculation on social media platforms used by protesters that the incident might have been staged.

Others worried that the attack could be used to call off the city’s District Council elections scheduled for Nov. 24. The pro-establishment camp has long dominated those elections, but the opposition could make strong gains this year because of widespread anger with the government.

Hong Kong is a semiautonomous Chinese territory. The city’s top leader is picked by an election committee of about 1,200 that is controlled by pro-Beijing interests, but more than half of local lawmakers are directly elected by Hong Kong’s citizens. This year’s protests, prompted by since withdrawn legislation that would have allowed Hong Kong residents to be extradited to China for trial, have expanded to include demands of greater democracy and more accountability for the police.

Mr. Ho, who was elected to the Hong Kong legislative council in 2016, took on a prominent role as one of the protest movement’s chief enemies after a group of men with sticks and metal bars attacked people in a train station on July 21. At least 45 people were injured, including protesters, journalists, bystanders and a pro-democracy lawmaker.

Mr. Ho was seen in a video from that night shaking hands with men in white T-shirts, the uniform of the attackers, and saying, “You guys are my heroes.” He denied any connection with the attack, saying he was merely talking with people he encountered on a walk.

Later in July, Mr. Ho broadcast a video in which he appeared to make a death threat toward a pro-democracy lawmaker. In September a night of horse racing at the Happy Valley Racecourse in Hong Kong was canceled after a competition including a horse partly owned by Mr. Ho became a focus of possible protest.