China has ordered the lockdown of as many as 13 million people in neighbourhoods and workplaces in the northern city of Xi’an, the capital of Shaanxi Province, following a surge in coronavirus cases.

State media reported that city officials ordered all residents to stay at home unless they had a pressing reason to go out, and suspended all transport to and from the city apart from special cases.

The order was to take effect at midnight and last indefinitely.

One person from each household will be permitted out every two days to buy household necessities, the order said.

A Covid-19 testing site in Xi’an, Shaanxi Province, where millions of people have been ordered to stay at home (Li Yibo/Xinhua via AP)

On Wednesday Xi’an reported 52 new locally transmitted cases of coronavirus over the previous 24 hours.

China has adopted strict pandemic control measures leading to frequent lockdowns, universal masking and mass testing.

Those measures have been stepped up in recent days in preparation for the start of the Beijing Winter Olympic Games on February 4.

The Xi’an restrictions are some of the harshest since China imposed a strict lockdown in 2020 on more than 11 million people in and around the central city of Wuhan after Covid-19 was first detected there in late 2019.