HONG KONG — China has detained an employee of the British Consulate in Hong Kong after he crossed the border into the mainland, his family and his girlfriend said, raising fears that the Chinese authorities might be targeting travelers they suspect of supporting the Hong Kong protests.

The apparent detention of the employee, Cheng Man Kit, a trade officer for the consulate, was striking in that it highlighted many of the fears that ignited the protests. The demonstrations began in June over a bill that would allow extradition to mainland China, which critics said would put the city’s residents at risk of facing the murky judicial Chinese system controlled by the Communist Party.

Mr. Cheng, who is 28 and also goes by the name Simon, traveled to Shenzhen, the city just across the border from Hong Kong, to attend a business conference on Aug. 8, but did not return the same day as planned, his family said in a statement on Wednesday morning. It said a lawyer had confirmed his detention in Shenzhen but not the reasons for it, nor his whereabouts.

He exchanged messages with his girlfriend, Annie Li, even as he was heading back to the border that night aboard the recently opened high-speed railway that links Shenzhen to Hong Kong. “Passing through,” he wrote to her in English on WeChat, the Chinese message app, at 10:42. “Pray for me.” As of Tuesday, he had not been heard from since.