Chinese people in Hong Kong are going to great lengths to get back to the mainland as COVID-19 takes hold in the formerly virus-free financial hub, posing a challenge for officials fearful of contagion.

On Friday, hundreds of people queued at a border checkpoint between Hong Kong and Shenzhen, with many waiting hours to get through the checks and processes. Most have family ties with the mainland or are Chinese nationals studying or working in Hong Kong.

They join a stream of people racing to leave Hong Kong: Departures via land routes — all but one of which go directly to mainland China — tripled to 24,697 in the first 17 days of February from a year earlier, according to Immigration Department data.