MEXICO CITY — On bad days, you can smell the stench from a mile away, drifting over a nowhere sprawl of highways and office parks.

When the Grand Canal was completed, at the end of the 1800s, it was Mexico City’s Brooklyn Bridge, a major feat of engineering and a symbol of civic pride: 29 miles long, with the ability to move tens of thousands of gallons of wastewater per second. It promised to solve the flooding and sewage problems that had plagued the city for centuries.

Only it didn’t, pretty much from the start. The canal was based on gravity. And Mexico City, a mile and a half above sea level, was sinking, collapsing in on itself.

It still is, faster and faster, and the canal is just one victim of what has become a vicious cycle. Always short of water, Mexico City keeps drilling deeper for more, weakening the ancient clay lake beds on which the Aztecs first built much of the city, causing it to crumble even further.

It is a cycle made worse by climate change. More heat and drought mean more evaporation and yet more demand for water, adding pressure to tap distant reservoirs at staggering costs or further drain underground aquifers and hasten the city’s collapse.

In the immense neighborhood of Iztapalapa — where nearly two million people live, many of them unable to count on water from their taps — a teenager was swallowed up where a crack in the brittle ground split open a street. Sidewalks resemble broken china, and 15 elementary schools have crumbled or caved in.

Much is being written about climate change and the impact of rising seas on waterfront populations. But coasts are not the only places affected. Mexico City — high in the mountains, in the center of the country — is a glaring example. The world has a lot invested in crowded capitals like this one, with vast numbers of people, huge economies and the stability of a hemisphere at risk.

One study predicts that 10 percent of Mexicans ages 15 to 65 could eventually try to emigrate north as a result of rising temperatures, drought and floods, potentially scattering millions of people and heightening already extreme political tensions over immigration.

The effects of climate change are varied and opportunistic, but one thing is consistent: They are like sparks in the tinder. They expose cities’ biggest vulnerabilities, inflaming troubles that politicians and city planners often ignore or try to paper over. And they spread outward, defying borders.

That’s what this series is about — how global cities tackle climate threats, or fail to. Around the world, extreme weather and water scarcity are accelerating repression, regional conflicts and violence. A Columbia University report found that where rainfall declines, “the risk of a low-level conflict escalating to a full-scale civil war approximately doubles the following year.” The Pentagon’s term for climate change is “threat multiplier.”

And nowhere does this apply more obviously than in cities. This is the first urban century in human history, the first time more people live in cities than don’t, with predictions that three-quarters of the global population will be urban by 2050. By that time, according to another study, there may be more than 700 million climate refugees on the move.

For many cities around the world, adapting to climate change is a route to long-term prosperity. That’s the good news, where societies are willing to listen. But adaptation can also be costly and slow. It can run counter to the rhythms of political campaigns and headlong into powerful, entrenched interests, confounding business as usual. This is, in effect, what happened in New Orleans, which ignored countless warning signs, destroyed natural protections, gave developers a free pass and failed to reinforce levees before Hurricane Katrina left much of the city in ruins.

Unlike traffic jams or crime, climate change isn’t something most people easily feel or see. It is certainly not what residents in Mexico City talk about every day. But it is like an approaching storm, straining an already precarious social fabric and threatening to push a great city toward a breaking point.

As Arnoldo Kramer, Mexico City’s chief resilience officer, put it: “Climate change has become the biggest long-term threat to this city’s future. And that’s because it is linked to water, health, air pollution, traffic disruption from floods, housing vulnerability to landslides — which means we can’t begin to address any of the city’s real problems without facing the climate issue.”

There’s much more at stake than this city’s well being. At the extreme, if climate change wreaks havoc on the social and economic fabric of global linchpins like Mexico City, warns the writer Christian Parenti, “no amount of walls, guns, barbed wire, armed aerial drones or permanently deployed mercenaries will be able to save one half of the planet from the other.”

Buildings now undulate where once the area was flat.

Sprawl and Subsidence

An element of magical realism plays into Mexico City’s sinking. At a roundabout along the Paseo de la Reforma, the city’s wide downtown boulevard, the gilded Angel of Independence, a symbol of Mexican pride, looks over a sea of traffic from the top of a tall Corinthian column.

Tourists snap pictures without realizing that when Mexico’s president cut the ribbon for the column in 1910, the monument sat on a sculptured base reached by climbing nine shallow steps. But over the decades, the whole neighborhood around the monument sank, like a receding ocean at low tide, gradually marooning the Angel. Fourteen large steps eventually had to be added to the base so that the monument still connected to the street.

Deeper in the city’s historic center, the rear of the National Palace now tilts over the sidewalk like a sea captain leaning into a strong headwind. Buildings here can resemble Cubist drawings, with slanting windows, wavy cornices and doors that no longer align with their frames. Pedestrians trudge up hills where the once flat lake bed has given way. The cathedral in the city’s central square, known as the Zócalo, famously sunken in spots during the last century, is a kind of fun house, with a leaning chapel and a bell tower into which stone wedges were inserted during construction to act more or less like matchbooks under the leg of a wobbly cafe table.

Volcanic soil safeguarded the water supply for centuries.

Loreta Castro Reguera is a young, Harvard-trained architect who has made a specialty of the sinking ground in Mexico City, a phenomenon known as subsidence. She pointed down a main street that stretches from the Zócalo and divides east from west, following the route of an ancient Aztec dike.

The whole city occupies what was once a network of lakes. In 1325, the Aztecs established their capital, Tenochtitlán, on an island. Over time, they expanded the city with landfill and planted crops on floating gardens called chinampas, plots of arable soil created from wattle and sediment. The lakes provided the Aztecs with a line of defense, the chinampas with sustenance. The idea: Live with nature.

Then the conquering Spaniards waged war against water, determined to subdue it. The Aztec system was foreign to them. They replaced the dikes and canals with streets and squares. They drained the lakes and cleared forestland, suffering flood after flood, including one that drowned the city for five straight years.

“The Aztecs managed,” Ms. Castro said. “But they had 300,000 people. We now have 21 million.”

An 18th-century engraving. Historical Picture Archive/Corbis, via Getty Images

Mexico City today is an agglomeration of neighborhoods that are really many big cities cheek by jowl. During the last century, millions of migrants poured in from the countryside to find jobs. The city’s growth, from 30 square miles in 1950 to a metropolitan area of about 3,000 square miles 60 years later, has produced a vibrant but chaotic megalopolis of largely unplanned and sprawling development. Highways and cars choke the atmosphere with heat-inducing carbon dioxide — and development has wiped out nearly every remaining trace of the original lakes, taxing the underground aquifers and forcing what was once a water-rich valley to import billions of gallons from far away.

The system of getting the water from there to here is a miracle of modern hydroengineering. But it is also a crazy feat, in part a consequence of the fact that the city, with a legacy of struggling government, has no large-scale operation for recycling wastewater or collecting rainwater, forcing it to expel a staggering 200 billion gallons of both via crippled sewers like the Grand Canal. Mexico City now imports as much as 40 percent of its water from remote sources — then squanders more than 40 percent of what runs through its 8,000 miles of pipes because of leaks and pilfering. This is not to mention that pumping all this water more than a mile up into the mountains consumes roughly as much energy as does the entire metropolis of Puebla, a Mexican state capital with a population akin to Philadelphia’s.

Even with this mind-boggling undertaking, the government acknowledges that nearly 20 percent of Mexico City residents — critics put the number even higher — still can’t count on getting water from their taps each day. For some residents, water comes only once a week, or once every several weeks, and that may mean just an hour of yellow muck dripping from the faucet. Those people have to hire trucks to deliver drinking water, at costs sometimes exponentially higher than wealthy residents pay in better-served neighborhoods.

Some residents rely on “pipas,” large trucks with hoses that deliver water from aquifers.
A pipa in the San Andrés Totoltepec neighborhood.

Overseeing the city’s water supply is a thin, patient man with the war-weary air of an old general: Ramón Aguirre Díaz, director of the Water System of Mexico City, is unusually frank about the perils ahead.

“Climate change is expected to have two effects,” he told me. “We expect heavier, more intense rains, which means more floods, but also more and longer droughts.”

If it stops raining in the reservoirs where the city gets its water, “we’re facing a potential disaster,” he said. “There is no way we can provide enough trucks of water to deal with that scenario.”

“If we have the problems that California and São Paulo have had,” he added, “there is the serious possibility of unrest.”

The problem is not simply that the aquifers are being depleted. Mexico City rests on a mix of clay lake beds and volcanic soil. Areas like downtown sit on clay. Other districts were built on volcanic fields.

Volcanic soil absorbs water and delivers it to the aquifers. It’s stable and porous. Picture a bucket filled with marbles. You can pour water into the bucket, and the marbles will hardly move. Stick a straw into the bucket to extract the water, and the marbles still won’t move. For centuries, before the population exploded, volcanic soil guaranteed that the city had water underground.

Mexico City’s water crisis today comes partly from the fact that so much of this porous land — including large stretches of what Mexico City has supposedly set aside for agriculture and preservation, called “conservation land” — has been developed. So it is buried beneath concrete and asphalt, stopping rain from filtering down to the aquifers, causing floods and creating “heat islands” that raise temperatures further and only increase the demand for water. This is part of the sprawl problem.

Now, picture layered sheets of plastic. On a molecular level, clay acts sort of like that. It doesn’t really absorb water. Instead, water settles between the sheets. When the water is drained, the sheets can collapse and crack. If all of Mexico City were built on clay, it would at least sink at the same rate and “subsidence would be an anecdote,” Mr. Aguirre said.

But because the city is built on a mix of clay and volcanic soil, it sinks unevenly, causing dramatic and deadly fissures. In Iztapalapa, Pedro Moctezuma Barragán, director of ecological studies at the Metropolitan Autonomous University, climbed down into what felt like a ravine where a street had given way. He’s been tracking the problem for years. Fifteen thousand houses in the area, he said, had been damaged by sinking ground.

The Grand Canal was meant to solve flooding and sewage problems that had plagued the city for centuries.

‘The Center of Women’s Lives’

Deep below the historic center, water extracted from aquifers now can end up just beyond the city limits, in Ecatepec, at one of the largest pumping stations along the Grand Canal. The pump, completed in 2007, was built to move 11,000 gallons per second — essentially water that now needs to be lifted up from where the canal has collapsed, just so that it can continue on its way.

The man in charge of this herculean undertaking is Carlos Salgado Terán, chief of the department of drainage for Zone A in Mexico City, a trim, no-funny-business official in a starched bright green shirt. According to Mr. Salgado, the Grand Canal today is working at only 30 percent of capacity because of subsidence. He admitted that it was a Sisyphean struggle to keep up with the city’s decline. Parts of the canal around Ecatepec have sunk an additional six feet just since the plant was built, he said.

He showed me around one morning. The canal is wide open, a stinking river of sewage belching methane and sulfuric acid. Apartment blocks, incongruously painted cheerful Crayola colors, hug the bank. A lonely tricycle sat in a parking lot near where the station’s giant, noisy engines churn out greasy white foam that coats the black water.

Today, the canal operates at only 30 percent of capacity.
A stretch of canal that runs under a road.

Mr. Salgado asked if I wanted a tour of the filters. “The smell can be unbearable, and it’s very unhealthy,” he cautioned.

The district of Tlalpan is on the opposite side of Mexico City. There, Claudia Sheinbaum, a former environment minister who developed the city’s first climate change program, is now a local district president. She has the slightly impatient, defensive mien of someone wrestling with an impossible mission.

“With climate change, the situation will only get much worse,” she said. A warming climate will only increase the city’s problems with pollution, specifically ozone. Heat waves mean health crises and rising costs for health care in a city where air-conditioning is not commonplace in poor neighborhoods. She seconded what Mr. Aguirre had said about the threat of drought. “Yes,” she said, “if there is drought we are not prepared.”

For the time being, Well 30 helps supply Tlalpan with drinking water. One recent morning, large trucks, called “pipas,” some with neat lettering that promised “agua potable,” crowded a muddy turnoff beside the highway. From a low cinder-block building, painted red, scrawled with graffiti and crowned in barbed wire, sprouted two long, angled pipes connected to dangling hoses. The arrangement of the pipes and hoses looked something like the gallows in a game of hangman.

These pipes plunge 1,000 feet down to reach an aquifer. Trucks, endlessly, one after another, wait their turn to fill up, positioning themselves beneath the hoses.

This is where residents of Tlalpan get water when they can’t get it from their faucets. It takes more than 500 trips a day to satisfy the parched citizens of the district. Juan José López, the district representative at the well, distributes assignments from a desk in the red building piled with stacks of orders that residents file. Drivers wait at his window, as at a fast-food drive-through, to pick up their assignments.

“The pump is always working,” Mr. López said. “At least it is still good water.”

To the east, in Iztapalapa, some wells tap into a noxious stew contaminated by minerals and chemicals. Angry residents wait in lines overnight to plead with pipa drivers, who sometimes pit desperate families against one another, seeing who pays the bigger bribe.

Fernando González, who helped manage the water supply for Iztapalapa for 32 years, said the health effects of contaminated water were clear to residents whose infants regularly broke out in rashes and whose grandparents suffered colitis.

In some cases, the wait for water trucks can make the cable guy look punctual: Deliveries may be promised in three to 30 days, forcing residents to stay home the whole time, because orders are canceled if there’s no one in the house when the trucks arrive.

“Water becomes the center of women’s lives in places where there is a serious problem,” points out Mireya Imaz, a program director at the National Autonomous University of Mexico. “Women in Iztapalapa can spend all night waiting for the pipas, then they have to be home for the trucks, and sometimes they will ride with the drivers to make sure the drivers deliver the water, which is not always a safe thing to do.”

“It becomes impossible for many poor women to work outside the home,” she said. “The whole system is made worse by corruption.”

That’s pretty much what I heard talking to women in Iztapalapa. Virginia Josefina Ramírez Granillo was standing in the courtyard of a community center in San Miguel Teotongo, a hilly neighborhood o