The NHS illegally handed Google the data of more than one and a half million people, the UK's data watchdog has found.

The Royal Free NHS Foundation Trust in London "failed" to comply with data protection rules when it gave 1.6 million patient records to Google-owned artificial intelligence company DeepMind for a trial, the Information Commissioner's Office has ruled as it ordered tighter guidelines.

The Trust and Google did not properly inform patients how their details were going to be used in the test, which used technology to monitor and diagnose acute kidney injury, the commissioner said following a year-long investigation.

The trial, which began in 2015, used technology to track patients' symptoms and send alerts to doctors through an app called Streams in the event of a drastic change in their health. It was designed to look for acute kidney injury, which affects up to 18 per cent of those admitted to hospital.

As part of the deal between the Trust and Google, the internet giant gained access to sensitive patient information such as HIV status, mental health history and abortions. The Royal Free did not tell patients that Google's DeepMind would have access to such information, but said it had "implied consent" because patients knew the Streams app offered "direct care".