Hong Kong CNN  — 

As the number of people killed by the coronavirus passes 500,000 worldwide, China isn’t taking any chances of a second wave gripping the country – despite having largely contained its outbreak in recent months.

In stark contrast to the relaxing of restrictions amid spiking infection rates in the United States and parts of Europe, about 400,000 people have been placed under strict lockdown in Anxin county, in the central province of Hebei, near Beijing, after just 18 fresh cases were detected.

Officials announced in a statement Sunday that “all villages, communities and buildings will be fully closed” in Anxin. Families are only permitted to send one person per household outside to purchase supplies once a day – and all outside vehicles are banned.

Anxin lies around 150 kilometers (90 miles) south of Beijing, where a small outbreak this month was met with “wartime” measures.

In mid-June, a cluster of cases was linked to a fresh produce market in the southwest of the capital. As it emerged that infections had already spread to nearby Liaoning and Hebei provinces, there was widespread alarm over the potential of a second wave across China.

Authorities quickly imposed a lockdown on 11 residential compounds in the vicinity of the market, prohibiting anyone from entering or leaving. Residents had their temperatures checked and reported on a daily basis, and their food and daily necessities delivered.

Beijing also rolled out mass nucleic acid testing for the coronavirus, setting up 193 sampling booths across the city. More than 76,000 people were tested within 48 hours of the cluster being detected.

Speaking to CNN in May, China’s top respiratory expert Dr. Zhong Nanshan warned that China still faced the “big challenge” of a potential return of the virus, and authorities should not be complacent.

“The majority of … Chinese at the moment are still susceptible of the Covid-19 infection, because (of) a lack of immunity,” Zhong said. “We are facing (a) big challenge, it’s not better than the foreign countries I think at the moment.”

Efforts to contain the outbreak in Beijing appear to have been successful so far – demonstrating again the effectiveness of lockdowns, social distancing and mask wearing combined with widespread testing. On Sunday, there were just eight new cases detected in the city, down from dozens only a week ago.

Almost 8 million Beijing residents had been tested for the coronavirus, local authorities said on Sunday, with the number of daily tests expanded from 40,000 to more than 450,000.

CNN’s Nectar Gan contributed reporting.