The city of Shanghai will be locked down in two stages over nine days while authorities carry out Covid-19 testing.
The important financial hub has battled a new wave of infections for nearly a month, although case numbers are not high by some international standards.
Authorities had so far resisted locking down the city of some 25 million people to avoid destabilising the economy.
But after Shanghai recorded its highest daily number of cases on Saturday since the early days of the pandemic, authorities appear to have changed course.
The lockdown will happen in two stages, with the eastern side of the city under restrictions from Monday until 1 April, and the western side from 1-5 April.
Public transport will be suspended and firms and factories must halt operations or work remotely, authorities said.
The city government published the instructions on its WeChat account, asking the public "to support, understand and cooperate with the city's epidemic prevention and control work".
Other lockdowns during the pandemic have affected entire Chinese provinces, though people could often still travel within those regions. But Shanghai, due to its high population density, is the largest single city to be locked down to date.
It is China's commercial capital and by some calculations the biggest city in the country - but is now one of the worst-hit areas as China fights to contain a resurgence of the virus with Omicron, leading to a spike in new cases.
Officials had until now said the eastern Chinese port and financial hub must keep running for the good of the economy. The staggered approach to this lockdown means half the city will remain functioning at a time.
Millions of residents in other Chinese cities have been subjected to citywide lockdowns, often after a relatively small number of Covid cases.
Challenge to zero-Covid
The recent surge in cases in China, although small compared to some countries, is a significant challenge to China's "zero-Covid" strategy, which uses swift lockdowns and aggressive restrictions to contain any outbreak.
The policy sets China apart from most other countries which are trying to live with the virus.
But the increased transmissibility and milder nature of the Omicron variant has led to questions over whether the current strategy is sustainable in the long run.
Some Shanghai residents have complained about the seemingly endless cycles of testing, suggesting that the cost of zero-Covid had become too high.
China's national health commission reported more than 4500 new domestically transmitted cases on Sunday.