The men, who were found guilty after a trial last month, were involved in what detectives described as a “shadow policing operation… conducted on behalf of the Hong Kong authorities, and by extension, the Chinese state”.

The case raised serious questions about foreign interference and the ability of hostile states to gather information on individuals living in Britain.

Cdr Helen Flanagan, Head of Counter Terrorism Policing London, said in a statement that the investigation shows this kind of activity in the UK will not be tolerated.

“I want to be really clear that if you are working on behalf of a foreign state, that we in counter-terrorism policing and with our partners will identify who you are and bring the full force of the National Security Act upon you.”

Security Minister Angela Eagle said the government “will continue to hold China to account and take action against anything that puts the safety of people in our country at risk”, including Hong Kong police’s use of arrest warrants and bounties.

In the public gallery on Thursday, a number of pro-democracy activists from Hong Kong watched as the sentences were handed down. Among them was one activist who has had a HK$1 million (£100,000) bounty placed on her by authorities in Hong Kong.

Wai was a former UK police officer who began working as a Border Force officer at Heathrow Airport in December 2020.

He used his access to a vast database of information about foreign nationals in the UK to trace Hong Kongers who had fled pro-democracy crackdowns for his Chinese contacts.

He was sentenced to six years for assisting a foreign intelligence service and four additional years for misconduct in public office.

Yuen, a former Hong Kong police officer who went on to work as the office manager of the Hong Kong Economic and Trade Office in London, became Wai’s contact with Chinese authorities.

When Wai started working at Heathrow, he sent a message to the former chief superintendent of Hong Kong Police’s Criminal Intelligence Bureau Eddie Ma, who still had links to the Chinese state.

“Will not let any cockroaches in,” Wai wrote.

During a trial in May, the court heard that “special attention” was also paid to British politicians, such as Conservative MP Sir Iain Duncan Smith.

Wai, who holds both British and Hong Kong passports, has had many jobs – including as an officer with the Metropolitan Police from 2015 to 2019.

He was in the Royal Navy for eight years, and worked for a company providing security for events in Chinatown. Wai had also set up his own company, D5 Security.

After leaving the Met, he became a volunteer constable for City of London Police.