A city in China apologized after calling out and shaming its residents for wearing pajamas in public.

Officials in the eastern Chinese city of Suzhou cracked down on wearing nighttime clothes out of the house in a city ordinance intended to cut down on "uncivilized behavior."

The city's management bureau posted pictures online of seven people dressed in the forbidden wear, along with the offenders' names and government IDs, according to the BBC.

The images were caught with surveillance cameras.

China's use of sophisticated facial recognition technology became a focal point for last year's demonstrations in Hong Kong, where protesters used masks to conceal their identities.

The range of "bad behavior" shamed by Suzhou officials included lying on benches and passing out promotional flyers.

City officials apologized after being criticized on Chinese social media platform Weibo, where the news was originally published, Inkstone reported.

"We wanted to put an end to uncivilized behavior, but of course, we should protect residents' privacy," they said, according to the BBC and Inkstone.

The BBC reported that officials will blur the individuals' faces, though it is unclear whether the practice of public shaming will cease.

Follow Joshua Bote on Twitter: @joshua_bote