Wuhan, China, on May 15 launched an ambitious citywide campaign to test every one of its 11 million residents for the coronavirus.
The mass testing in the epicenter of the coronavirus outbreak was prompted by a rise in asymptomatic cases of COVID-19—people who are infected but show no symptoms of the disease—that raised fears of a second wave of cases.
Children under 6 and people who had already been recently tested were exempted from the initiative. Taking those exemptions into account, Wuhan is nearing its goal, having tested more than 6.5 million people in 10 days. Here’s how it pulled off the feat:
The Wuhan government coughed up an estimated $140 million for the campaign, with the government covering individual test costs. It also paid to employ thousands of medical workers to conduct testing. Workers made house calls for elderly and disabled people, roamed streets and construction sites to find migrant workers, and set up testing tents in residential compounds.
Wuhan health workers have swabbed samples from more than 9 million people, which makes up more than 90% of the city’s target for sampling, according to Chinese state media. Over 6.5 million of those samples have been tested, and the rest are still being processed.
When the Wuhan government announced the mass testing plan on May 11, it called the effort a “10-day battle.”
Testing capacity ramped up massively after the official launch of the campaign on May 15, when 113,609 coronavirus tests were carried out. One week later, on May 22, more than 10% of the city’s population—1.47 million people—were tested in a single day.
For comparison, on that same day, May 22, New York State tested around 45,000 people. As of Tuesday, the state had conducted a total of 1.7 million tests. In the U.S. as a whole, 15 million people have been tested for the coronavirus.
The “10-day battle” officially ended on May 24, when the Wuhan government announced that more than 9 million samples had been collected.
The city says it is now in a “checking for gaps and patching up leaks” phase, to search for and test residents who missed out on the initial push. Wuhan residents who had never undergone a coronavirus test were instructed to register and arrange testing by May 26.
Authorities increased testing capacity so dramatically by using a batch testing method that allows for faster processing of samples but may compromise the accuracy of the results.
The method combines swab samples from up to 20 people to test as a single sample; if the sample tests positive, then the individuals will be retested one by one. This saves time—if the sample tests negative, then all 20 people can be checked off as negative for the virus—but it could lead to logistical problems like overly diluted samples, Chinese financial newsmagazine Caixin reported.
The batch testing method works best in areas with low infection rates, where there isn’t a high chance that every batch would need to be retested.
The method could help the U.S. increase its testing capacity and aid with reopening. A lab in Nebraska is currently carrying out batch testing, and researchers there reported that they are saving 50% to 60% worth of material and time compared to individual sample testing.
Wuhan carried out testing systematically. Testing priority went to densely populated buildings and residential compounds with previous community outbreaks.
Test drive sites were set up in the open air to minimize infection risk, and people had assigned time slots, wore masks, had their temperatures checked, and were told to maintain distance while they queued.
Citizens receive their test results via a notification on their mobile phones, and their health codes—app-based QR codes that give each person a coronavirus risk rating and determine what public services they can use—are updated accordingly.
The millions of tests have so far turned up a total of 206 asymptomatic cases. Those people will be isolated and observed under medical quarantine to see if they develop symptoms. If they do, they’ll be hospitalized; if they don’t, they’ll be monitored until they test negative for the virus.
More must-read international coverage from Fortune:
—Inside China’s reopening: 7 personal stories of life after lockdown
—Photo essay: What life looks like in Europe as the continent starts to reopen
—Reopening of Shanghai Disneyland is a proving ground for pandemic-era theme parks
—Trump’s demand that China pay coronavirus reparations evokes an ugly history
—PODCAST: How Marc Benioff is helping out during the coronavirus pandemic
—WATCH: The global crisis in recycling
Subscribe to How To Reopen, Fortune’s weekly newsletter on what it takes to reboot business in the midst of a pandemic