Many of the world’s most important farming regions can’t rely on rain alone to water all their crops. So they also pull freshwater from underground aquifers that have slowly filled up over many thousands of years. Notable examples include the Central Valley in California or the Indus Basin in Pakistan and India.

The problem is that these underground aquifers take a long, long time to recharge. So if farmers are drawing water faster than it gets replenished, the basins will eventually run dry. This is a looming concern in California right now, as farmers dig deeper and deeper for groundwater to cope with the ongoing drought. But for a look at how bad things can really get, check out Saudi Arabia.

Saudi Arabia depleted its aquifers, and agriculture collapsed

Over at Reveal News, Nathan Halverson has a terrific piece on how Saudi Arabia squandered its groundwater supplies in just a few short decades. Back in the 1970s, the government allowed landowners to dig as many wells as they desired, in order to transform the desert into lush farmland. An agricultural boom followed, and Saudi Arabia improbably became the world’s sixth-largest exporter of wheat.

“By the 1990s, farmers were pumping an average of 5 trillion gallons a year,” Halverson writes. “At that rate, it would take just 25 years to completely drain Lake Erie.” The problem was that Saudi Arabia doesn’t get nearly enough annual rainfall to replace those withdrawals. Its aquifers had built up over tens of thousands of years and were now being drained all at once.

Not surprisingly, the party didn’t last. By the 2000s, the aquifers had become dangerously depleted. Wells dried up. Oases that had persisted since biblical times were now gone. The country will need to build costly desalination plants for drinking water. Most important, Saudi Arabia’s agricultural output declined sharply, with the amount of farmland now less than half of what it was in the 1990s. In an attempt to conserve what water remains, the country has announced that the 2016 wheat harvest will be its last. An entire industry, gone.

Saudi Arabia is an extreme case, but other aquifers are also in trouble

Saudi Arabia is a particularly glaring example of water mismanagement, but it’s hardly an isolated case. Earlier this year, researchers from the University of California Irvine used data from NASA satellites to measure the rate of groundwater depletion around the world. They found that a number of key freshwater aquifers were drained between 2003 and 2013 much faster than they could be recharged:

The researchers found that eight of the world’s 37 biggest aquifers were “overstressed” during this time frame, which meant that they were being drained quickly and there wasn’t much natural recharge. Topping their list was none other than the Arabian Aquifer System, which straddles Saudi Arabia and Yemen and supports some 60 million people. Also in worrisome shape were the Indus Basin that straddles India and Pakistan and the Murzuq-Djado Basin in Africa.

Beyond that, the researchers also categorized five major systems as “extremely” or “highly” stressed: They’re being replenished by some rainwater, but not nearly enough to offset withdrawals. That list included, notably, the aquifers underneath California’s Central Valley.

As California endures its fifth straight year of brutal drought, many farmers have been compensating for the lack of surface water by pumping groundwater at increasing rates. There are currently few regulations around this. In 2014, California passed a law to put aquifer management on sustainable footing, but that will take years to take effect.

These groundwater withdrawals have helped farmers weather the current drought, and they’re a big reason why California’s farm revenue hit record highs in 2013 and 2014. But they come at a long-term cost. The aquifers beneath the Central Valley are getting drained; farmers have to drill deeper and deeper wells each year; and the ground is actually sinking, which in turn means these aquifers will be able to store less water in the future, even after the rain comes again. That means less protection against future droughts. And, as the Saudi example shows, eventually farmers max out their credit.

So when will doomsday hit? That’s the thing: Nobody really knows. The UCI researchers pointed out that we don’t really have good estimates of how much water is actually in these underground basins, and estimates of storage for some areas tend to range widely, from decades to millennia. Ideally, governments would sponsor research to drill deeper down into the rock layers, take stock of their water supplies, and put withdrawals on a sustainable footing. Because once this non-renewable resource runs out, it can’t be easily replaced.