A new device that sits inside a shipping container can use clean energy to almost instantly bring clean drinking water anywhere–the rooftop of an apartment building in Nairobi, a disaster zone after a hurricane in Manila, a rural village in Zimbabwe–by pulling water from the air.

The design, from the Skysource/Skywater Alliance, just won $1.5 million in the Water Abundance XPrize. The competition, which launched in 2016, asked designers to build a device that could extract at least 2,000 liters of water a day from the atmosphere (enough for the daily needs of around 100 people), use clean energy, and cost no more than 2¢ a liter.

“We do a lot of first principles thinking at XPrize when we start designing these challenges,” says Zenia Tata, who helped launch the prize and serves as chief impact officer of XPrize. Nearly 800 million people face water scarcity; other solutions, like desalination, are expensive. Freshwater is limited and exists in a closed system. But the atmosphere, the team realized, could be tapped as a resource. “At any given time, it holds 12 quadrillion gallons–the number 12 with 19 zeros after it–a very, very, big number,” she says. The household needs for all 7 billion people on earth add up to only around 350 or 400 billion gallons. A handful of air-to-water devices already existed, but were fairly expensive to use.

The new system, called WEDEW (“wood-to-energy deployed water”) was created by combining two existing systems. One is a device called Skywater, a large box that mimics the way clouds are formed: It takes in warm air, which hits cold air and forms droplets of condensation that can be used as pure drinking water. The water is stored in a tank inside the shipping container, which can then be connected to a bottle refill station or a tap.

Because the process uses a large amount of electricity, designers paired it with a biomass gassifier, a low-cost source of energy. When the gassifier is filled with wood chips, coconut shells, or whatever biomass is locally available, a process calls pyrolysis vaporizes that material. That makes the system hot and humid, the ideal environment to run the air-to-water machine. As it generates power, it also produces biochar, a charcoal that can be added to soil to store carbon and help plants grow.

“It’s a carbon-negative technology,” says David Hertz, a California-based architect who helped lead the project. “I think the future of technologies is going to be moving to this restorative, regenerative model that actually helps to repair the damage we’ve done.”

In a place like California, the gassifier could be fed with pine trees that have been killed by years of drought and pests. Left in forests, the dead trees are at risk of burning in fires and releasing CO2. In the machine, the carbon in the wood could be captured and added to soil as the system creates fresh water.

In parts of the world where wood is less available, the system could also run on solar and battery power rather than biomass. In either case, it can quickly be deployed off the grid in areas where water is polluted or where supplies have dwindled because of drought. “Our process is one that is really antithetical to the slow-moving infrastructure that exists that is not able to be responsive to a changing climate as it is in the case of say, Cape Town, for instance,” Hertz says.

Though the Skywater machine is already in use in some areas, the new combination with biomass power only exists because of the competition. The team will use the prize money to rapidly develop and deploy the units worldwide in partnership with nonprofits.

“One could imagine these shipping containers being positioned in a state of readiness throughout the world to be able to respond to disasters for both energy and water,” he says.