SHANGHAI — China has flooded cities and villages with battalions of neighborhood busybodies, uniformed volunteers and Communist Party representatives to carry out one of the biggest social control campaigns in history.

The goal: to keep hundreds of millions of people away from everyone but their closest kin.

The nation is battling the coronavirus outbreak with a grass-roots mobilization reminiscent of Mao-style mass crusades not seen in China in decades, essentially entrusting front line epidemic prevention to a supercharged version of a neighborhood watch.

Housing complexes in some cities have issued the equivalents of paper hall passes to regulate how often residents leave their homes. Apartment buildings have turned away their own tenants if they have come from out of town. Train stations block people from entering cities if they cannot prove they live or work there. In the countryside, villages have been gated off with vehicles, tents and other improvised barriers.

Despite China’s arsenal of high-tech surveillance tools, the controls are mainly enforced by hundreds of thousands of workers and volunteers, who check residents’ temperature, log their movements, oversee quarantines and — most important — keep away outsiders who might carry the virus.