The Spanish owners of the O2 phone network are to profit from personal patient data handed over by NHS bosses in Britain.

Industry giant Telefonica has struck a deal letting it trawl patient histories to develop software to predict mental health crises.

This will help it develop a computer program set to be a huge moneyspinner.

Privacy campaigners say it’s “yet another example of a private company getting its hands on personal data using the pretext of research to improve a public service.”

Eva Blum-Dumontet of Privacy International said: “When patients turn to the NHS for mental health issues it’s with the expectation that their issues will stay between them and the NHS.

Eva Blum-Dumontet of Privacy International said: “When patients turn to the NHS for mental health issues it’s with the expectation that their issues will stay between them and the NHS"

"Can we really trust a private company with collecting and manipulating data? Could they use it for profiling their own customers?"

Telefonica has 23 million UK O2 customers which helped it to make £2.77billion profits in 2018.

Individual data is passed on by Birmingham and Solihull Mental Health Foundation Trust only if patients agree to share it.

So far Telfonica has been given anonymous patient histories to helps its software predict when they will need to see their doctor.

But phase two of the research could also let the firm access calls, messages and locations from patients’ mobile phones.

Telefonica said: “The healthcare data does not leave NHS servers and is not used by Telefonica for any reason outside the pilot.”