A new device could solve two problems in one stroke – producing both electricity and clean water using sunlight.

Researchers say it could be hugely useful for around 780 million people worldwide who lack electricity infrastructure and access to safe drinking water.

The device - described in the journal Nature Communications - consists of a normal silicon solar cell strung horizontally over the top of channels in which saline, brackish or contaminated surface water is run.

Waste heat from the solar cell warms the salty water beneath it, causing the water to evaporate, pass through a membrane and condense into clean water.

The heat is then released to warm and purify the saline water in the tier below that, and so on.

Tests so far have shown that the device can purify saltwater as well as seawater contaminated with heavy metals like lead, copper, sodium, calcium and magnesium, up to safe drinking levels according to the World Health Organization.

The device combines two technologies that usually each take up a lot of space and infrastructure – desalination centres and solar farm – into a relatively compact form.

On a bright, cloudless day, the energy efficiency of the solar cell in the combined system is about 11 per cent – close to what would be expected without the distillation section attached.

In can produce clean water from seawater at a rate the researchers say is higher than conventional solar stills.

The designers say they are working hard to push the technology towards large-scale adoption.