HONG KONG — When Hong Kong, a former British colony, returned to Chinese control in 1997, one of the biggest worries was how the Chinese military would behave.

Images of the People’s Liberation Army killing civilians on the streets of Beijing eight years earlier were still fresh in the minds of Hong Kong residents, who had marched in huge numbers to support the pro-democracy Tiananmen protests, and who had begun marking the anniversary of the 1989 crackdown with a yearly vigil.

As troop trucks and armored personnel carriers rolled into Hong Kong after its handover from Britain, residents wondered what the soldiers would do next. But in the 22 years since then, the People’s Liberation Army has had a very limited role in the city.

This summer, however, after weeks of antigovernment demonstrations and some incidents of violence, questions about the military have been revived. Chinese officials and state media have reacted with increasing vitriol to the protesters, particularly after some painted slogans on the central government’s liaison office in Hong Kong on Sunday night and splashed ink on the national crest.