Macau ordered compulsory coronavirus testing for all residents on Wednesday after a family of four was found to be carrying the Delta variant, breaking the city's record of over 16 months virus-free.
Over the next three days authorities plan to test all 680,000 residents at 41 testing centres, the government said.
The testing is one of a host of new measures announced after the gambling hub recorded 491 days without a single local infection.
Authorities are investigating whether the daughter of the family contracted the virus on a flight from Zhuhai to Xi'an in mainland China in July, Macau's leader Ho Iat-seng said on Wednesday.
The same flight carried two other infected people from Nanjing, the centre of a Delta-variant outbreak in China that has led to more than 300 new cases across 15 provinces and cities in two weeks.
Long queues formed on Wednesday morning outside testing centres and the city's health app crashed, local media reported.
Macau has adopted mainland China's health app, which rates infection risk, tracks movement and generates test and vaccination records.
"I have to say sorry to all residents," Ho told reporters.
Macau has kept infections low by closing itself off from the rest of the world for much of the pandemic and placing restrictions on arrivals from mainland China.
It has recorded only 60 cases and no deaths.
But the zero-Covid strategy has come with deep economic costs for the only place in China where gambling is allowed.
Macau's casinos account for about 80 percent of government revenue.
The city ordered a shutdown of all casinos for two weeks when the virus was first detected last year, causing a loss of $937 million, according to an estimate by the University of Macau.
Revenues have climbed this year as some of the border restrictions with mainland China were relaxed but they remain well below pre-pandemic levels.