HONG KONG—China appears to have brought two recent large coronavirus outbreaks under control and has turned its focus to Beijing, where health authorities are ramping up testing and tightening containment protocols as the Chinese capital prepares for the Lunar New Year and the Winter Olympics.

Chinese authorities this week lifted a roughly monthlong lockdown of the central Chinese city of Xi’an, where a Delta outbreak had spread last month. The port city of Tianjin, which neighbors Beijing, declared victory over an Omicron...

HONG KONG—China appears to have brought two recent large coronavirus outbreaks under control and has turned its focus to Beijing, where health authorities are ramping up testing and tightening containment protocols as the Chinese capital prepares for the Lunar New Year and the Winter Olympics.

Chinese authorities this week lifted a roughly monthlong lockdown of the central Chinese city of Xi’an, where a Delta outbreak had spread last month. The port city of Tianjin, which neighbors Beijing, declared victory over an Omicron outbreak, lifting most of the restrictions on its citizens.

On Thursday, Beijing reported 19 of the country’s 49 locally transmitted Covid-19 cases from the past two days, according to official data provided by the National Health Commission. While the majority of Beijing’s cases had been infected with the Delta strain, six patients tested positive for the Omicron variant, Beijing’s government said during a news conference Wednesday.

Roughly two million residents of Beijing’s southwestern district of Fengtai were required to line up in freezing temperatures for a third round of mass testing Wednesday, part of stepped-up pandemic control measures the city has implemented to control outbreaks ahead of the 2022 Games, which open in eight days.

“The situation is going to be strict for a while,” said Mei Xinyu, a trade expert and resident of Fengtai, where most of Beijing’s new cases have been found. Mr. Mei took tests on Sunday and Tuesday before being informed by text message he needed to do a third on Wednesday morning.

Chinese health authorities have used a mixture of targeted lockdowns, mass testing and restrictions on movement to keep total confirmed Omicron infections low.

Photo: Kevin Frayer/Getty Images

Home to the world’s strictest Covid-19 control regime, China has so far been remarkably successful in controlling local outbreaks of the fast-spreading Omicron variant. While the U.S. has wrestled with millions of new cases, Chinese health authorities have used a mixture of targeted lockdowns, mass testing and restrictions on movement to keep total confirmed Omicron infections in the low triple digits for all of China thus far.

Still, with two major events set to unfold in the coming days, Chinese officials face immense pressure to continue the relentless eradication of outbreaks.

The first event is the Lunar New Year holiday, which officially begins Tuesday. In the past, the weeklong holiday involved the world’s largest seasonal human migration, with hundreds of millions of people crisscrossing the country to gather with relatives. In mid-January, China’s Ministry of Transport predicted people would take a total of nearly 1.2 billion trips during the holiday season this year, compared with around three billion in pre-pandemic years.

Officials have urged people in high- and medium-risk areas to minimize their travel, though they have stopped short of issuing a ban. Searches for “spending Lunar New Year in place” more than quadrupled compared with last year among people who worked in a different city than they were from, according to data collected by Chinese search engine operator Baidu Inc.

The Beijing Winter Games are scheduled to kick off just a few days later on Feb. 4. With a few exceptions, all athletes, journalists and other participants in the Olympics are required to be vaccinated or to do three weeks of quarantine and present a negative Covid test before being allowed to enter a “closed loop” sealed off from the rest of the city.

The International Olympic Committee said in a statement this week that Chinese authorities had agreed to lower the testing threshold to enter the bubble after some Olympic delegations expressed concerns that athletes who had already recovered from an infection might test positive and be denied the chance to compete. All participants are still required to report their health status daily for two weeks before entering the closed loop.

Meanwhile, local authorities have been conducting targeted lockdowns of residential compounds and checking the health codes—digital certificates stored on smartphones that grant access to public venues—of anyone entering the city. The municipal government also issued an order requiring anyone who buys fever, sore throat, cough or cold medicine to take a Covid-19 test within 72 hours.

On Wednesday evening, Fengtai district locked down more residential compounds and said residents should get a daily nucleic acid test, urging everyone to stay in their compounds when possible. Mass testing has also been carried out in other districts and residential compounds within the capital city of 21 million, although not all have been mandatory.

Related Video

China is enforcing a strict set of Covid-19 rules at the Winter Olympics to stop the fast-spreading Omicron variant. From a "closed-loop” system to a ban on shouting, WSJ explains how some of these restrictions will work, and why despite all efforts, an outbreak could still derail competitions. Photo: Fabrizio Bensch/Reuters The Wall Street Journal Interactive Edition

On Monday, local officials in Xiong’an, a satellite city roughly 60 miles southwest of Beijing, issued a statement urging the nearly 1.3 million residents to get tested and stay at home after they found five new Covid-19 cases.

Ivy Meng, a 35-year-old Beijing resident and tech-company employee, took the first of three recent Covid-19 tests on Saturday after she received phone calls from the local police and her residential compound management office. The officials explained to her that tracking data showed she had passed through Shanghai’s Jing’an district—which was classified as a medium-risk zone after a local case was detected there two weeks ago—during a recent business trip.

Her health code had turned red and only went back to green after her first test result came in negative on Saturday night.

On Wednesday, Ms. Meng went to get tested after work. “It’s quite convenient because the testing site is right in our complex,” she said.

In other parts of China, the number of daily new cases is dwindling. Xi’an, which was placed under the strictest citywide lockdown since Wuhan was sealed off in the early days of the pandemic in 2020, has recorded no new cases since Thursday. It has removed most of its restrictions on travel and shopping, leaving only a few malls and restaurants subject to social-distancing rules.

Tianjin, a seaport of 14 million roughly 60 miles east of Beijing, declared victory against the Omicron variant on Tuesday after first detecting it on Jan. 8.

A local health official ascribed the success to swift action, centralized quarantine, restrictions on the movement of people and suspension of social gathering activities. The fourth and final round of Tianjin’s citywide mass testing was completed in 4.5 hours, 90 minutes faster than the first round of mass testing, reported China’s state-run Xinhua News Agency Tuesday.

Those tight measures have come at a cost. Eurasia Group included China’s strict adherence to a zero-tolerance approach in its list of top political risks for 2022, pointing to a steady increase in disruptive measures since the arrival of the Delta variant in mid-2021 and their impact on the service sector as well as the supply-chain problems.

China’s approach has meant short periods of major disruption for some parts of the country but allowed life elsewhere to go on largely as normal, wrote Cui Ernan, an analyst at the consulting firm Gavekal Dragonomics, in a research note, predicting consumer activity this holiday season will approach pre-pandemic levels.

Ms. Meng, the Beijing-based tech worker, said her husband had been discouraged from leaving the city for the Lunar New Year holiday, which meant her efforts to celebrate the holiday would be disrupted by Covid-19 for a third straight year.

Despite suffering cabin fever and being irritated by other pandemic disruptions, she said she has learned to accept her country’s stringent approach to the pandemic.

“Maybe it’s all about perspective,” she said. “We haven’t had to deal with high case and death counts, and the grief and tragedy that comes with it.”

Write to Sha Hua at sha.hua@wsj.com