The leaked CCTV footage which exposed Matt Hancock’s affair was in the public interest, the Prime Minister’s spokesman has said, as an investigation into an alleged data breach continues.

Two people suspected of recording the film without consent had their homes raided on Thursday by officials from the Information Commissioner’s Office (ICO).

Police and Crime Commissioners have also called for the police to launch an urgent investigation amid concern over the security of government buildings.

But the Prime Minister’s official spokesman said Boris Johnson believed in the importance of a free press being able to investigate matters that were in the public interest.

The ICO has the power to impose an unlimited fine if someone is convicted of an offence under the Data Protection Act. The raids on people’s homes have led to concern that whistleblowers might be put off coming forward to raise matters that are in the public interest.

Asked whether Mr Johnson had any concerns about the fact the whistleblowers were now under investigation, his spokesman said: “It’s obviously the case that the ICO are investigating, and as such it would be inappropriate for me to comment any further while that investigation is ongoing.

“But more broadly, the Prime Minister previously has spoken about his belief of the importance of a free press, which can investigate matters that are in the public interest.”

Asked if the Prime Minister had been informed ahead of the raids, he replied: “It’s an independent investigation, so it is led by them, it’d be inappropriate for me to comment.”

Mr Hancock resigned last month after footage of him kissing his lover, Gina Coladangelo – who was also a paid Department of Health and Social Care (DHSC) official – was leaked to The Sun newspaper.

The footage is understood to have been captured by a CCTV camera inside Mr Hancock’s office.

The ICO – which investigates data breaches – was called in by Emcor Group, the company that provides the CCTV network at the DHSC, in a bid to identify those responsible.

Matt Hancock and Gina Coladangelo: a timeline

A spokesperson for Emcor said: “We can confirm that we submitted a breach report, as the Department of Health and Social Care’s data processor, alleging images were recorded from the Department of Health and Social Care CCTV system without consent.”

It is believed the DHSC identified the suspects last month and officials from the ICO have seized a number of electronic devices, including mobile phones and computers, in a bid to establish whether any data breaches had occurred.

Lucy Frazer, the Solicitor General, said it was right “as a general principle” for the ICO to carry out an investigation into an alleged data breach surrounding the revelations.

Asked whether she supported the action, Ms Frazer told LBC Radio: “I do think that where people have breached security rules, it is appropriate to investigate, but that investigation is ongoing.”

Pressed on whether there was public interest in the information being in the public domain, the minister said: “I think those matters, having been brought to the public attention, it was right for Matt Hancock to resign, and that’s why he did resign, absolutely.”