NEW DELHI — For months, the police say, a group of men took turns raping an 11-year-old girl.

In the gated community in Chennai, India, where the girl lived with her parents, the men gave her soft drinks laced with drugs, the police said. They filmed themselves raping her, brandishing knives and threatening to release the videos if the girl told her family, the police said.

The men were not intruders in the gated community, but employees who greeted residents, operated the elevator or brought water coolers to apartments.

When news broke on Monday that the authorities in Chennai, a coastal city in the southeast, had arrested 17 men accused of raping or molesting the girl over a period of seven months, chaos erupted at the complex in an older part of the city. Residents dismissed the building’s remaining staff members. Women volunteered to guard the complex’s entrances, and some called for the suspects to be hanged.

Indian television channels ran lengthy news segments with banner headlines that read, simply, “Chennai Horror.”