China reported a record number of local Covid-19 cases on Monday, as authorities extended a sweeping lockdown in Shanghai in an effort to curb the country’s worst outbreak in more than two years.

China recorded more than 16,400 new local Covid cases for Monday, according to the National Health Commission, the highest daily tally in mainland China in more than two years. More than 80% of the latest daily cases were in Shanghai, the commission said on Tuesday.

China’s pandemic defenses are facing their sternest test since Covid-19 first spread widely in the central city of Wuhan in early 2020. The highly infectious Omicron variant has led to spiraling case counts across the country, posing a challenge for Chinese President Xi Jinping ahead of an important Communist Party Congress later this year, when he is expected to be sworn in for a precedent-breaking third term in office. China has previously touted its success at being able to quickly and relatively painlessly control Covid outbreaks.

Authorities in Shanghai, China’s financial hub, said late Monday they would keep the city of 25 million residents shuttered, even though an original two-stage lockdown was set to end Tuesday. Officials said the lockdown would continue while the situation is evaluated and the result of citywide Covid testing is analyzed.

Shanghai reported over 13,000 new local infections Tuesday, China’s health commission said. The total case count was more than triple the number reported nine days ago, when it announced it would lock down the city in two phases.

At least 390 areas in populous provinces such as Guangdong, Jilin and Shandong, have been labeled medium or high risk, according to the health commission. Any area labeled as such is subject to some form of lockdown and sealed off from other areas, according to official guidance issued by the health commission last May.

The city of Changchun, a manufacturing hub in northeastern Jilin province, entered its 26th day of lockdown on Tuesday. Government officials initially allowed one member in each household to go out to buy food and other necessities every two days. However, as the pandemic showed no signs of easing and the confirmed cases kept climbing, the Changchun local government further tightened control measures in late March, conducting a round of mandatory mass testing across the city and said it would make sure that high-risk residential quarters are fenced off—literally if needed—from the rest of the city.

On Sunday, Changchun kicked off a five-day period to stamp out infections in the city. During these five days, it aims to test every resident in the city’s central districts three times; all confirmed cases and their close contacts will be transported to quarantine facilities.

In China, local authorities have adhered to a strategy of trying to stamp out outbreaks quickly wherever they occur, resulting in sudden and often wide lockdowns that have paralyzed cities and confined millions of residents to their homes. The disruptions have also interrupted factory production, business operations and exacerbated supply-chain snarls in the nation.

Empty roads during a lockdown in Shanghai.

Photo: Qilai Shen/Bloomberg News

China’s previous Covid case record was recorded on Feb. 12, 2020, when 15,000 cases were reported, the bulk of them in Hubei province, the capital of which is Wuhan. Since then, there have been sporadic outbreaks in areas including the northwestern province of Jilin and the economically important coastal city of Shenzhen. Hong Kong has also been mired in its own Covid wave since late February, though cases have declined recently to around 3,000 a day.

The decision to extend the Shanghai lockdown came amid a visit by Vice Premier Sun Chunlan, the official charged by Mr. Xi to lead the fight against the virus. After inspecting testing sites and quarantine centers, Ms. Sun urged local officials to work toward stamping out the spread in the city as quickly as possible, according to a statement posted on Shanghai’s government website.

Jianxin Chen, a 37-year-old securities-firm employee, has stayed at home for over three weeks since the first case was detected in his neighborhood. As a salesman, he wasn’t working as Shanghai entered two-phase isolation. “It felt like a vacation at first and the food supply was stable,” he said.

He expected the lockdown to be extended as the metropolis continued to be bogged down in the fight against the Omicron variant. “Even if the government lifted the ban, I dare not leave my apartment until it is under control,” he said. In order to secure fresh food for his family, he joined an effort in his neighborhood to arrange bulk purchases of groceries.

Others are starting to get more anxious about their food supplies, as delivery workers are stuck at home.

Epermarket, an online grocer that operates in several Chinese cities, said some of its products are out of stock because many of its suppliers as well as the Shanghai port have been locked down.

In addition, Epermarket said on its social-media account Tuesday, most of its workers in Shanghai remain homebound, with less than one-fifth having special passes to go out as essential workers. It said it hopes to get more passes and get deliveries to customers in coming days.

Since the outbreak, thousands of medical workers, including from the People’s Liberation Army, have gone to Shanghai to help with mass testing and logistics.

Over the past two years, the financial hub, with a local economy of over $660 billion in 2021, had tried to avoid a blanket lockdown and instead relied on more targeted restrictions, focusing on shops or buildings where infections were found.

This prolonged shutdown coincides with the Qingming Festival, a Chinese national holiday also known as Tomb-Sweeping Day, traditionally reserved for people to visit their ancestors’ graves. With cemeteries closed and in-person tomb-sweeping events banned by the municipal government, Shanghai residents have sought creative ways to pay their respects to the dead.

Gravesites in Beijing during the Qingming Festival.

Photo: mark r cristino/Shutterstock

Many have turned to “tomb-sweeping via valet” or virtual tomb sweeping. At least one major state-owned cemetery in Shanghai is providing flower delivery to gravesites on behalf of families. Clients make their orders online, and an employee at the cemetery will live stream the entire ritual, from bowing to the tombstone to lighting incense and offering up flowers.

Hong Kong-listed Fu Shou Yuan International Group Ltd. , a large burial- and funeral-services provider, offers Chinese families the option to purchase flowers and offerings to be delivered by a staffer. These range from about $5.50 for a bouquet of chrysanthemums to around $100 for a representative to light incense, set out food offerings and clean the tombstone.

Chinese officials have also been encouraging families to avoid travel and to offer their prayers online. The Ministry of Civil Affairs said in a statement on March 21 that this year’s Qingming Festival would be a “major test” for China’s Covid-prevention efforts.

On April 3, the first day of the three-day Qingming holiday, the number of people visiting cemeteries in person fell by 70% to 5.83 million, data from the ministry showed.

Write to Rebecca Feng at rebecca.feng@wsj.com and Liyan Qi at liyan.qi@wsj.com