HONG KONG—Beijing said it is at a critical point in its efforts to halt a Covid-19 outbreak in the city, as new cases spread from school students and a tour group, while deaths in Shanghai more than tripled from a day earlier.

The Chinese capital recorded 22 new cases on Sunday, its highest daily tally this year. Shanghai, which a week ago had recorded no new deaths in the latest wave of infections, said 39 Covid patents died Saturday—more than three times Friday’s toll.

While still low by global standards, the latest numbers are a challenge to the ability of China’s top leaders to wipe out outbreaks with their zero-Covid policy. As pockets of infections flare up in the country’s most important cities, local officials are desperate to avoid a repeat of the economic disruption and growing public discontent seen in the financial hub of Shanghai, large parts of which have been under lockdown for weeks.

But the Chinese leadership has vowed to stick to their zero-Covid strategy, which has helped regions such as Jilin province successfully contain the virus after six weeks of lockdowns, they said. The northeastern province is the hardest-hit region after Shanghai. Cases have also been rising the past week in Jiangsu and Hebei, the provinces surrounding Shanghai and Beijing.

In Beijing, the infections included several cases in a middle school in Chaoyang District, and three family members of one of the infected students. Other cases were traced to a tour group and a delivery worker.

The virus had been spreading undetected among different communities for a week, Beijing health officials had said Saturday. More cases will be found as the city steps up its screening efforts, they said.

After the school was sealed off and classes suspended, Beijing’s Communist Party boss Cai Qi visited the site and ordered more Covid tests for all the middle and primary schools in Chaoyang. He also ordered the suspension of all face-to-face tutoring in the district.

Presiding over a meeting on Saturday, Mr. Cai said speed was vital to containing infections.

“This wave is menacing and stealthy, and its origin unclear—and transmission fast,” he said.

The new fatalities brought the death toll in China’s current outbreak to 89, all but two of them in Shanghai. Existing ailments such as late-stage cancer or diabetes were the direct cause in all of Shanghai’s cases, in which the average age of victims was 81, a city health official said Sunday.

Shanghai added 21,058 new cases on Saturday, bringing total infections in the city of 25 million to 490,000 since a wave of the highly contagious Omicron variant hit the financial capital on March 1.

Of those who died, only five were vaccinated against Covid, said Zhao Dandan, a deputy director of Shanghai’s health commission. The city would add more medical resources to treat severe cases, she said, urging eligible elderly people to get vaccinated as soon as possible.

There have been outbreaks at many of Shanghai’s 800 nursing homes since Omicron hit the city in early March. In one facility, the Donghai Elderly Care Hospital, at least 40 patients died by April 6 after the virus spread through the hospital, a Wall Street Journal investigation showed.

Only 62% of Shanghai residents aged 60 and over are vaccinated. The rate drops to 15% for the 800,000 residents who are over 80, the latest official data show. Meanwhile, most, if not all, the vaccination sites are closed as the lockdown continues in many parts of the city.

Shanghai’s Jing'an District remained in lockdown on Saturday.

Photo: hector retamal/Agence France-Presse/Getty Images

Over the weekend, many residents who have been quarantined at home for weeks saw metal fences being erected around their buildings, as the authorities ordered another round of restrictions to wipe out the remaining infections. Some of the barriers have been removed after residents protested, according to social-media posts that were verified by the Journal.

City leaders met Saturday evening in Hangzhou, a technology hub that is home to

Alibaba Group Holding Ltd. , after more than 100 new cases were detected in the city since Tuesday. They ordered compulsory tests for all residents of Gongshu District and several neighborhoods in other areas, vowing to spare no resources in wiping out the virus.

Movements of residents in those areas were restricted for three days effective Saturday, the officials said in a statement.

It wasn’t yet possible to determine the source of the outbreak, which has already spread to schools, hospitals, supermarkets and other business venues. “The virus is likely to spread wider,” they said.

Write to Wenxin Fan at Wenxin.Fan@wsj.com