HONG KONG — When word came that a dangerous new virus was killing people in mainland China, the people of Hong Kong sprang into action. Virtually overnight, the schools were closed, posters appeared around the city reminding residents to wash their hands, and seemingly everyone on the street was wearing a face mask.

While the West debated the efficacy of masks, Hong Kong residents, stung by the deadly SARS outbreak 17 years ago, put their trust in them. In the months since the pandemic began on its doorstep, only four people in Hong Kong, a city of 7.5 million, have died from Covid-19.

But behind the ubiquitous masks is a truth that not everyone here knows. Millions of Hong Kong’s surgical masks are produced by prisoners, some of whom have been working late at night for mere pennies since the outbreak hit.

The medium-security Lo Wu prison, located near the mainland border, has been churning out masks 24 hours a day since February, when the Hong Kong government ramped up production to supply the city’s army of medical, public health and sanitation workers.