A British private investigator and his wife have been charged in Shanghai for illegally collecting private data on behalf of GlaxoSmithKline (GSK).

Peter Humphrey, 58, and his wife Yu Yingzeng, 60, have been in detention for over a year and face a closed trial on August 7.

The couple was arrested in a noon raid by Chinese police two months after they started working for GSK.

A spokesman for GSK said the couple had been hired “to conduct an investigation following a serious breach of privacy and security related to the company’s China general manager”.

Xinhua, the official Chinese news agency, said the couple were the first foreigners to be charged with conducting an “illegal investigation” by Chinese prosecutors. If found guilty, they are likely to be imprisoned for three years.

While the charges relate to their work for GSK, the state-run Legal Daily newspaper said the couple “made millions of yuan every year” and had conducted more than 700 investigations in the past decade.

“They investigated a huge number of people, illegally conducting their household registration information, their car licence plate numbers, looking into their families, the logs of when they entered and left China, their phone records and their corporate files,” reported the newspaper.

“They bought this information, paying 800 yuan (£80) to 1000 yuan (£100) each time. They took covert photographs, they sneaked into properties and they used false identities,” it added.

Clients of the couple’s firm, ChinaWhys, included “large multinationals, including financial companies, manufacturing firms and law firms”, according to the Chinese media.

“We did not know there had been a change in the Chinese law and that is our biggest problem,” Mrs Yu said, according to the Legal Daily.

“I want to tell you specifically everything about this GSK business,” her husband added. “They lied to me.”

Mr Humphrey and his wife were hired after an internal whistleblower sent long and detailed allegations of corruption in the company’s China business to the main board.

Subsequently, another email included a sex tape of Mark Reilly, the China head, and his then girlfriend.

“I told them I need to see the whistleblower’s letters to analyse them but I was not allowed to,” said Mr Humphrey to the Legal Daily. “Mark Reilly told me everything in the anonymous letter was just a slur on the company and they refused to provide more details, they just asked me to do my investigation.”

Both Mr Humphrey and his wife have told consular officials that they are suffering from a range of serious health problems. Mr Humphrey has not been allowed to have medication for his arthritis since January.

“He saw his wife in a corridor on May 29,” said a family friend, citing the latest report from consular officials. “She was only about 10ft away but she did not recognise him. He was very upset and felt she looked dazed and disorientated.”

For their trial, scheduled on the afternoon of August 7, Mr Humphrey has asked for a neck brace “because his head keeps falling to the left”. The request was denied.

“Spine, hernia and prostate treatment have been withheld and he is in constant pain,” said the friend, citing the consular officials.