BEIJING  The community is walled and gated, an enclosure of rows of crowded low-rise homes and shops, where people live under the gaze of surveillance cameras and apart from the city. The police patrol around the clock, and security guards stop unfamiliar faces to check identification papers. In the morning, only one gate is open, through which parents head off to work and children go to school. At night, the gate is locked, preventing street loiterers from trespassing.

The area, Shoubaozhuang, is not one of the affluent, gated residential compounds springing up around Beijing, but a poor village of rural migrants toiling at low-paying jobs. It was chosen, along with 15 other areas in the Daxing district of Beijing, to be walled off to outsiders, in what officials say is an experimental effort to curb crime. The authorities say the experiment has been a success  the Communist Party-run People’s Daily said the crime rate in the walled villages in Daxing district dropped by 73 percent from April to July this year  and the “walled village” concept is being quickly expanded to other districts outside Beijing’s center that are populated by migrant workers.

Ultimately, the project could encompass an area of 291 square miles with a population of 3.4 million people, more than 80 percent of them migrant workers.

Some residents welcome the walls and gates as a way of fighting crime, but critics have seized on the ghettolike villages as a jarring sign of the barriers facing rural migrants settling in urban areas. They say the real intent of the new measures is to keep track of the migrants, and some have labeled the policy a form of apartheid.