Hong Kong lacks the resources for a China-style pandemic response, the city’s leader says.

Hong Kong is struggling to get a handle on its worst coronavirus outbreak since the start of the pandemic, warning that it doesn’t have the testing capacity to carry out the strict strategy handed down by Beijing.

In Shenzhen and Shanghai, in mainland China, officials imposed restrictions on millions of people within days of local outbreaks in order to test every single resident. But Hong Kong’s chief executive, Carrie Lam, noted on Monday that her city doesn’t have the same ability.

“Hong Kong is very different from many mainland cities and therefore we cannot have any comparison,” Mrs. Lam told reporters at a news conference.

The difference amounts to resources and systems of governance, Mrs. Lam said. Shenzhen and Shanghai can test millions of people a day; Hong Kong’s health officials can only test between 200,000 and 300,000 people a day.

It is a strategy that has been dictated by Beijing but one that appears increasingly out of reach for Hong Kong, which continues to hold freedoms that don’t exist in the mainland.

In the Chinese cities of Wuhan and Xian, officials halted daily life and confined residents to their homes for weeks until there were no more local cases. In Tianjin, they began testing every single resident after just 20 cases of coronavirus were reported.

Further separating Hong Kong from the mainland’s approach, Mrs. Lam said she would not consider tightening social-distancing measures because she had to take into how residents felt about them.

“I have to consider whether the public would accept further measures, so we would not just casually roll out further distancing measures,” Mrs. Lam said.

The outbreak and Mrs. Lam’s ability to get it under control has been seen as a test of her leadership, though not one determined by ordinary Hong Kong people. The election of the city’s next leader will take place on May 8 and will be decided by an “election committee” of more than 1,400 people who are loyal to China’s Communist Party.

Mrs. Lam has been under pressure from the public to commit to a timeline for mass testing since she first raised the possibility in mid-February.

Fears of a Wuhan or Xian type of lockdown have prompted residents to empty supermarket shelves and hoard medicine. It has also led to an exodus of the city’s expatriate community, many of whom have grown tired of two years of strict pandemic measures and uncertainty about how and when the city’s restrictions will end.

“If you want us to follow what Shenzhen is doing, that is to introduce compulsory universal testing within three days, I’m afraid we are not up to it,” Mrs. Lam said. “This is a reality we have to face up to.”

On Monday, officials for Hong Kong’s international airport announced that mainland airline passengers will no longer be able to take a ferry from Shenzen’s Shekou Port to Hong Kong’s international airport, suspending the service, beginning Tuesday.

Adeel Hassan contributed reporting.