Bottles of water twirl on the conveyor belts of the Berain water factory in Riyadh, as a puddle of water collects on the concrete floor. In a second warehouse, tanks emit a low hum as water brought in from precious underground aquifers passes through a six-stage purification process before bottling.

“In Saudi Arabia there are only two sources of water: the sea and deep wells,” says Ahmed Safar Al Asmari, who manages one of Berain’s two factories in Riyadh. “We’re in the central region, so there are only deep wells here.”

Most water withdrawn comes from fossil deep aquifers and predictions suggest these may not last more than 25 years UN

Perhaps not surprising for someone who makes a living selling water, Asmari professes to be untroubled about the future of Saudi Arabia’s water supply. “Studies show water in some reserves can stand consumption for another 150 years,” he says. “In Saudi Arabia, we have many reserves – we have no problems in this area.”

His confident predictions are out of sync with the facts. One Saudi groundwater expert at King Faisal University predicted in 2016 that the kingdom only had another 13 years’ worth of groundwater reserves left.

“Groundwater resources of Saudi Arabia are being depleted at a very fast rate,” declared the UN Food and Agriculture Organisation as far back as 2008. “Most water withdrawn comes from fossil deep aquifers, and some predictions suggest that these resources may not last more than about 25 years.”

Facebook Twitter Pinterest Fans spray water on Muslim pilgrims around the Grand Mosque in the run up to the annual Hajj pilgrimage in Mecca, Saudi Arabia. Photograph: Dar Yasin/AP

In a country that rarely sees rain, the habit of draining groundwater, like the Berain factory does, could prove perilous: groundwater makes up an estimated 98% of naturally occurring fresh water in Saudi Arabia.

Indeed, oil may have built the modern Saudi state, but a lack of water could destroy it if drastic solutions aren’t found soon.

The emergency seems invisible in Riyadh, which is undergoing a construction boom as more buildings creep upwards to join a collection of towering skyscrapers.

It’s the desert. Obviously water is a natural constraint Dr Rebecca Keller

Although everyone knows this city in the desert owes its existence to the discovery of oil in 1938, fewer realise water was just as important. Decades of efforts to make the desert bloom to feed the city’s population have resulted in agricultural projects to grow water-intensive crops such as wheat, on farmland meted out to figures favoured by the royal family.

While many question the accuracy of the kingdom’s optimistic estimates of its own oil reserves, the looming threat of a lack of water could prove to be an even bigger problem. Saudi Arabia consumes double the world average of water per person, 263 litres per capita each day and rising, amid a changing climate that will strain water reserves.

Facebook Twitter Pinterest Saudi Arabia leads the world in the volume of desalinated water it produces, and now operates 31 desalination plants such as the one pictured, located outside Riyadh. Photograph: Fahad Shadeed/Reuters

In March, the Kingdom launched the Qatrah programme to demand citizens drastically cut their water use. Its aim is to ration water to 200 litres per person per day by 2020 and 150 litres by 2030.

It has also tried to reform the water-hungry agriculture industry, reducing government incentives for cereal production. The overall amount of irrigated farmland still hasn’t declined, though, as producers switch to more profitable crops that still require large amounts of water. Almarai, a major food producer, has begun buying up deserted land in the US, on plots near Los Angeles and in Arizona, and in Argentina, in order to grow water-rich alfalfa to feed its dairy cows.

The Saudi Arabian National Transformation Plan, also known as Vision 2020 – a subset of the Vision 2030 initiative intended to diversity the Kingdom’s economy away from oil – aims to reduce the amount of water pulled from underground aquifers for use in agriculture. It seeks to employ 191% of these water resources for farming, down from the current estimates of 416% of water available.

The Cityscape: get the best of Guardian Cities delivered to you every week, with just-released data, features and on-the-ground reports from all over the world

“This means that Saudi Arabia is using more than four times the water that renews on average – and that’s in Vision 2020,” says Dr Rebecca Keller from Stratfor – a private intelligence and geopolitical analysis firm – who says she was shocked after learning about the country’s water use. “Technically they’re using fossil water, which renews at a really, really slow rate. The sheer volume of overuse stood out to me.”

Desalinating sea water has long been seen as a silver bullet against the growing threat of water shortages across the Middle East. Saudi Arabia leads the world in the volume of desalinated water it produces, and now operates 31 desalination plants. Desalinated water, as distinct from naturally occurring fresh water, makes up 50% of water consumed in Saudi Arabia. The remaining 50% is pulled from groundwater.

Facebook Twitter Pinterest Changing water consumption habits remains the toughest challenge for Saudi Arabia. Photograph: Hasan Jamali/AP

It comes as at a high-energy cost, however. According to the International Energy Agency, in 2016 desalination accounted for 3% of the Middle East’s water supply but 5% of its overall energy cost. Researchers at King Abdelaziz University in Jeddah estimate that the demand for desalinated water increases by roughly 14% each year, but add that “desalination is a very costly process and is not sustainable”. Desalination plants also harm the surrounding environment, pumping pollutants into the air and endangering marine ecosystems with their run-off.

A recent push towards using solar power rather than fossil fuels to desalinate means that the first commercial plant is expected to be up and running at 2021 at the earliest, although it reportedly remains behind schedule.

An 'oasis' for women? Inside Saudi Arabia’s vast new female-only workspaces Read more

Keller says Saudi Arabia’s evolving use of desalination technology could also alter their relationship with other countries in the region, in particular Israel. “They’re producing the most cutting-edge technology for desalination, especially at scale,” she said. “As we see [both countries] having more geopolitical things in common in terms of their attitude to Iran, there’s more room for this relationship to grow, and the Saudi water sector is something that could benefit from this cooperation.”

The toughest challenge of all remains switching consumption habits to avoid an impending water emergency. The kingdom is pressing ahead with its Red Sea Project, a tourism haven the size of Belgium that aims to attract a million visitors annually to its unspoiled beaches and 50 new hotels. Such mammoth construction means growing water use, with current estimates that the string of resorts will use 56,000 cubic metres of water per day.

“It’s the desert,” said Keller. “Obviously water is a natural constraint.”

Follow Guardian Cities on Twitter, Facebook and Instagram to join the discussion, catch up on our best stories or sign up for our weekly newsletter