A recent coronavirus outbreak in Beijing sowed fears of a second wave of infections in China, but officials appear to have beat back the disease with a new targeted strategy.
Authorities did not repeat the drastic nationwide shutdown seen when the virus first spread from Wuhan earlier this year.
Instead, they sealed off a limited number of residences and focused on mass testing, eventually screening more than half of the capital's 21 million people.
This approach seems to have paid off, with reported cases falling to single digits each day by early July and zero in the past three days.
Here is a look at how China brought the new outbreak under control:
- How did the outbreak begin? -
China went to great lengths to protect its capital at the height of the pandemic, redirecting incoming flights to other cities and requiring visitors to undergo quarantine and virus tests.
But by early June, with just a handful of active cases across the country, Beijing had relaxed many of its restrictions and locals were no longer made to wear masks outdoors.
The emergence of a new patient on June 11 shocked the city.
Most of the 335 subsequent cases were traced to the sprawling Xinfadi wholesale market in southern Beijing, which was swiftly closed.
Thousands of people were placed under quarantine and 11 million people were tested for the virus.
The city banned outbound travel by residents living in at-risk areas and required others to show negative COVID-19 test results in order to leave.
Authorities are still investigating the cause of the outbreak, but early tests found traces of the virus on a cutting board at Xinfadi used to process imported salmon.
- How has China's handling of the pandemic evolved? -
After the virus first began to spread from Wuhan, China imposed a strict lockdown of the city and surrounding Hubei province in January that confined nearly 60 million people to their homes.
But in last month's outbreak, Beijing used what city authorities called "precise control" to lock down residential areas one neighbourhood at a time.
All food and beverage workers across the city were required to take virus tests and some bars were ordered to shut.
Most malls and restaurants in parts of the city where no cases had been detected were allowed to remain open, however.
The city focused on tracing and rapidly isolating everyone who had potentially been exposed to the virus.
Volunteers went door to door across the city, asking residents if they had been in contact with people who may have been exposed to the virus.
The tracking took on a dystopian tone at times.
Some residents were ordered to take virus tests after authorities used security camera footage of their car licence plates to determine that they had been near the market.
For that reason and others, Beijing is unlikely to serve as a model for other countries dealing with their own second-wave outbreaks.
"Nobody has the resources, capabilities, determination and financial ability, and of course social capital, to do this except China," Leong Hoe Nam, an infectious disease specialist at Singapore's Mount Elizabeth Novena Hospital, told AFP.
- Is this the 'new normal'? -
China's economy was hit hard by the lockdowns brought in to curb the initial spread of the virus.
That has made the country's communist government wary of one-size-fits-all shutdowns like the ones it imposed earlier this year.
"The country is unlikely to revert to old ways unless there is a more serious outbreak," IHS Markit senior economist Yating Xu told AFP.
Even at the peak of the latest outbreak, Beijing officials avoided closing the city's tourist sites and hotels.