BEIJING — With the din they make, they are often mocked and berated and worse. Dogs have been loosed on them. Rocks flung, water sprayed.

Yet those “dancing grannies,” the middle-aged and elderly outdoor dance enthusiasts who crowd sidewalks, parks and squares across China, have shimmied on.

Not even the excrement lobbed by irate residents has deterred them.

But last week, opposition to their boisterous line dancing took a violent turn, when a man in the southern region of Guangxi opened fire on a troupe near his home, wounding a woman in the leg, according to news reports on Friday.

The assailant fled but was captured Wednesday by the police, according to Xinhua, the state news agency.