A family negotiates their way through caked mud around a dried up section of the Theewaterskloof dam near Cape Town, South Africa, on January 20, 2018. Mike Hutchings / Reuters

The city of Cape Town was plonked by its founders onto a peninsula not far from where the Indian and Atlantic oceans merge, often violently, beneath the imposing banks of Table Mountain. To its north lie the fertile fruit and wine farms that weigh down the city’s restaurant tables with unimaginable bounty. Every day when the clock strikes noon, a cannon blast echoes from Signal Hill, a reminder of the city’s colonial heritage. It was established first as a vegetable garden by the Dutch East India Company in 1652, then repurposed as a stronghold for the British until the formation of the Union of South Africa in 1910; later it served as the apartheid regime’s parliamentary stronghold. In 2014, The New York Times declared it the best place in the world to visit. Britain’s Daily Telegraph concurred.

Today, Cape Town faces two catastrophic, extinction-level botherations. First, the rains that once fell so reliably during the winter months have tailed off. For the past three years, they have barely fallen at all—a phenomenon one meteorologist calls a once-in-628-years weather event. Second, Cape Town is one of the more unequal cities on earth, with the wealthy, mostly white, population living in toney coastal and inland suburbs, and the poor, mostly black, inhabitants shunted onto the flatlands, an hours-long commute from the city’s economic hub.

By current calculations, “Day Zero,” the dystopian term for the date by which the city is expected to run out of water, and when all water will be rerouted to emergency pick up points, is June 4. This will mark the first time that a major modern city has run out of municipal water. In 2008, Barcelona came close. Sao Paulo, the biggest city in the Western Hemisphere, teeters on the brink. The government of Indonesia has given serious consideration to abandoning chunks of Jakarta, which is paradoxically sinking below sea level, drowning in torrential rains, and running out of potable water. What is now certain is that Cape Town will become a test case for what happens when climate change, extreme inequality, and partisan political dysfunction collide.

Perhaps the most confounding thing about Cape Town is its whiplash-inducing contradictions. Its highways, airport, shopping malls, and restaurants, would be the envy of any American municipality. While corruption certainly exists in Cape Town, until the whole place started melting down last year it was the only metro in South Africa to receive clean audits. Yet hundreds of thousands of people live in shacks and informal settlements, with access mostly limited to a shoddy rail system and an expensive private mini-bus taxi network. In this regard, Cape Town is both an African city and a European outpost at the bottom of Africa, at once developing and developed.

So how does an ostensibly well-run city manage to blow the water file so spectacularly? In part, it comes down to the fact that its administration was paralyzed by a sort of bureaucratic magical thinking that combined technocratic hyper-efficiency, an obsession with austerity-driven bean-counting, and an apparent belief that miracles are certain to fall from the sky.

Since 2009, the Western Cape, of which Cape Town is the capital, has been governed by the Democratic Alliance (DA), the official opposition to the African National Congress (ANC). (A DA-led coalition won Cape Town from the ANC in 2006. They now run the city outright.) The DA is a strange beast, a party with a white-dominated federal executive, and, until 2015, a white leader. There’s a longstanding perception that the party serves the white population’s agenda, described by its enemies as maintaining economic apartheid at the expense of black advancement—a notion that Cape Town’s spatial divisions reinforce. (The party’s former leader, Helen Zille, who has also served as Cape Town’s executive mayor, has a habit of posting tweets extolling the benefits of colonialism, which hasn’t helped matters much.) Culturally and politically, the Cape is a world apart from the rest of South Africa.

Accordingly, the DA has long pitched itself to voters as a “clean” version of the horrifically corrupt ANC—it self-identifies as a liberal, social-democratic party in the stodgy German mold. Back when the ANC ran Cape Town, the rains fell mostly on schedule, and planning for the worst took a back seat to systemic corruption. The DA promised that it would do better. Instead, it has been bad, but in its own special ways. Its near-messianic adherence to fiscal rectitude has meant that local bureaucrats have tended to ignore repeated warnings from civil engineers and climate scientists, who insisted that Cape Town’s water infrastructure, which relies exclusively on six dams in parched catchment areas, would not be able to meet demand should rainfall patterns change due to climate change. Theewaterskloof Dam, the biggest and most vital feeder site, is in an area of the Western Cape that has been subject to creeping desertification for at least a decade. It is currently at 11.7 to 12.5 percent of its capacity, and effectively unusable.

The drought is so severe that planning for it would take genuine governmental prescience. But over the years, the Cape Town government has studiously ignored reams of data and studies readily available in the public domain. One of the first warnings that Cape Town would run dry was published in the Cape Times in 1990. Scientists, meteorologists, engineers and lay-folk have echoed those warnings in the years since. Emergency measures were considered and abandoned, with weather-like caprice: Desalination plants were deemed too expensive and cumbersome for a situation that the city’s bureaucrats believed would resolve itself. A fully completed plant in the nearby Mossel Bay municipality was mothballed in 2011; at slightly less than a dollar a kiloliter, the water it produced was deemed too expensive.

The DA has also encouraged big-money development in the city bowl and in coastal areas, which has massively driven up property prices and made stalwart allies (and donors) of the property developer class. Blue-chip, unsustainable developments populate the rich areas, and critics of the city’s policies insist that they churn through more than their share of water. The irony here is that if the city had been more amenable to mixed-income projects, there’d be far fewer wealthy water consumers along the thirsty coast, and more residents that conserve—largely because they wouldn’t be able to afford to do otherwise.

Of course, you can’t tell this story without mentioning the national government, dominated since the dawn of democracy by the dysfunctional ANC. While South Africa’s constitution placed the municipal water systems under the stewardship of local government, management of the so-called “bulk” national infrastructure—the larger networks that govern water delivery—falls to Department of Water and Sanitation Minister Nomvula Mokonyane. She seems to have no interest in her portfolio. Across the country, because of the usual combination of drought and mismanagement, water shutdowns in smaller communities have become the norm. Mokonyane has blamed the creeping nightmare on over-consumption. Regardless, water for many South Africans is steadily becoming a just another out-of-reach luxury product.

Jacob Zuma, who resigned as South Africa’s president on Wednesday, will be succeeded by an economy-obsessed, Davos-endorsed technocrat named Cyril Ramaphosa. He is unlikely to be so sanguine regarding Cape Town’s floundering. Compounding all of this is the fact that the Cape Town government was unwilling to admit the scale of the crisis, even to itself, until the middle of last year. In January 2018, the city finally announced that, starting on February 1, households consuming more than 350 liters of water a day would face fines and the installation of a water-management device on their property.

This cued the usual complaints: Why should the wealthy, who pay the most in rates and taxes, effectively subsidize water consumption in poor communities and in the farmlands, while facing a curtailment of the services they effectively underwrite? And why should high-income, tourist-friendly neighborhoods like Mouille Point be forced to host potential desalination plants, noisy eyesores that could just as easily be set up in less “desirable” communities? On the flipside, as a township resident and reporter named Suné Payne put it: “If my household of nine can survive on less than 350 liters of water a day, why can’t others?” In Cape Town, the poor have always faced water restrictions. “There used to be a name for it,” remarked one activist. “Apartheid.”

All of this can be avoided, or at least delayed, if consumption can be choked off at around 450 million liters per day. Farmers have been forced to accept the fact that their crops and vineyards will not receive water that was once shared with the municipality. This means a huge spike in food prices in the coming months. The city has devised what is being called a water pick-up point system, in which approximately 200 sites have been identified from which 25 liters will be distributed to 20,000 eligible residents each a day.

But details on how this scheme will work are sketchy. What contortions must an elderly person or a woman with two children endure in order to schlep all that water? The city also has yet to specify how these points will be policed. According to Richard Bosman, the city’s executive director for safety and security, “The risk grading will be done in accordance with the volume of people expected to pass through each water collection point, as well as the general crime trends in each area. Cape Town does have a number of gang hot spots and so this would be a crucial factor in determining whether a collection point is considered low or high risk.” There has been no elaboration on what this RoboCop-speak means, nor what it would entail. Meanwhile, Patricia De Lille, Cape Town’s executive mayor, has been accused of mismanagement and corruption; she faces a no-confidence vote today.

So what is to be done? In an age in which both the climate and politicians have gone rogue, the only good thing that can come of Cape Town’s crisis is how eloquently its inhabitants come up with new definitions of resilience. What unfolds in the next few months has a massive impact on the lives of all South Africans—cholera won’t stop at the foot of Table Mountain—but it also suggests a way forward for the rest of the world. Drought, or rather climate change, is only part of the reason that Cape Town is dying of thirst. The other failings are more readily addressed, but seem far more intractable.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.