In the fall of 1802, the German naturalist Alexander von Humboldt arrived in Callao, Peru’s major port, just west of Lima. Humboldt had timed his visit to coincide with a transit of Mercury, which he planned to observe through a three-foot telescope, in order to determine Lima’s longitude. He set up his instruments atop a fort on the waterfront, and then, with a few days to kill before the event, wandered the docks. A powerful stench emanating from boats loaded with what looked like yellowish clay piqued his curiosity. From the locals, Humboldt learned that the material was bird shit from the nearby Chincha Islands, and that it was highly prized by farmers in the area. He decided to take some home with him.

When human beings invented agriculture, some ten thousand years ago, they were, almost immediately, confronted with a conundrum. Crops need nutrients to grow, but harvesting them removes the nutrients, leaving the soil unfit for future harvests. Early farmers got around this bind by letting some fields lie fallow; spreading animal waste, including their own, on the land; and planting legumes, which possess restorative properties. But they had no clear idea why these practices worked. By Humboldt’s day, savants in Paris and London were starting to figure out what it was, exactly, that crops required. A Prussian chemist analyzed some of the clay Humboldt had brought home and found that it contained high concentrations of two essential nutrients: nitrogen and phosphorus. Guano offered an answer to the age-old problem of soil exhaustion; as Gregory Cushman, a historian at the University of Kansas, has observed, it “was the Miracle-Gro” of its moment.

Peru’s Indigenous people had been collecting guano from the Chincha Islands for centuries. (The word “guano” comes from the Quechua wanu.) But once Europeans decided to exploit the islands—they were delayed for a few decades by the Napoleonic Wars and the campaigns of Simón Bolívar—the Peruvian government enthusiastically extinguished all Native claims. In 1840, it agreed to a monopoly arrangement with some European merchants, and in the next fifteen years more than a million tons of guano made their way from Peru to the United Kingdom. The miserable work of harvesting the stuff was largely performed by Chinese laborers, under conditions of near-slavery.

By the mid-eighteen-forties, American farmers, too, had become gung ho for guano, and they were furious that the United States had failed to secure a steady supply. In 1850, President Millard Fillmore moved to rectify this situation, declaring that guano had “become so desirable an article” that it was incumbent on Washington to use “all the means properly in its power” to obtain it. In the spring of 1856, William Henry Seward, then a senator from New York, proposed what would become known as the Guano Islands Act; the bill, which became law later that year, deputized U.S. citizens to claim for their country any poop-covered “island, rock, or key not within the lawful jurisdiction of any other government.”

A rush to some of the world’s most remote landmasses ensued. Within three years, the United States had staked claims to nearly fifty islands, including those of Midway Atoll, in the North Pacific. The Baltimore American and Commercial Advertiser described these islands as the equivalent of “a new El Dorado” and proclaimed that although they possessed no actual gold, they would cover this country’s “wasted fields with golden grain.” (Seward would later engineer the purchase of Alaska, which critics dubbed Seward’s Icebox; by analogy, one historian has suggested that the U.S.’s guano islands might be considered Seward’s Outhouse.)

Guano exports from Peru peaked in 1870. Then they dropped dramatically. The shit exported to farms in Europe represented the cumulative output of millions of birds in the course of hundreds of generations. Once it had been shipped off, the birds that remained—many had seen their nesting grounds destroyed—couldn’t poop fast enough to keep up with demand. America lost interest in its de-guanoed islands. Most were eventually ceded to other countries; only a handful, like Midway, remain U.S. possessions.

But the end of the boom proved to be the beginning of something much bigger. Chemists identified other deposits of nitrogen and phosphorus, which replaced guano. When these sources were, in turn, exhausted, others were discovered, or, in the case of nitrogen, invented. Farmers can now purchase fertility as readily as they might buy seeds or plows. The result is a world awash in nutrients. This has created a new conundrum: How do we feed the planet without poisoning it?

The longest conveyor belt on earth begins in the town of Bou Craa and runs for sixty miles across Western Sahara to the port city of El Marsa. The region is so flat and so desolate that the conveyor stands out, even from space. According to nasa, the belt “has often attracted astronaut attention in this otherwise almost featureless landscape.”

The conveyor carries phosphorus-rich rock, which is mined in Bou Craa and then shipped from the coast to places like India and New Zealand to be processed into fertilizer. The mine, and indeed the vast majority of the rest of Western Sahara, is controlled—illegally, by most accounts—by Morocco, which possesses something like seventy per cent of the planet’s known phosphorus reserves.

The status of Western Sahara is one of the worries that Dan Egan takes up in his worrying new book, “The Devil’s Element: Phosphorus and a World Out of Balance” (Norton). Egan is a journalist who for many years reported on the Great Lakes, for the Milwaukee Journal Sentinel; it is the condition of Lake Erie that, in a roundabout, everything-in-the-modern-world-is-ultimately-connected way, seems to have led him to learn about Bou Craa. Egan quotes Jeremy Grantham, the British investor, who has said that Morocco’s hold over the planet’s phosphorus “makes opec and Saudi Arabia look like absolute pikers.” He also quotes Isaac Asimov, who once wrote, “Life can multiply until all the phosphorus is gone and then there is an inexorable halt which nothing can prevent.”

As Egan notes, phosphorus is critical not just to crop yields but also to basic biology. DNA is held together by what’s often called a “phosphate backbone”; without this backbone, the double helix would be a hash. The compound ATP provides cells with energy for everything from ion transport to protein synthesis; the “P” in the abbreviation stands for “phosphate.” In vertebrates, bones are mostly made up of calcium phosphate, as is tooth enamel.

What distinguishes phosphorus from other elements that are essential to life—carbon, say, or nitrogen—is its relative scarcity. (Asimov described phosphorus as “life’s bottleneck.”) The atmosphere contains almost no phosphorus. Phosphate-rich rocks, meanwhile, exist only in limited quantities, in certain geological formations. China holds the world’s second-largest reserves—these are less than one-tenth the size of Morocco’s—and Algeria the third-largest.

Since the early nineteen-sixties and the start of the Green Revolution, global consumption of phosphorus fertilizers has more than quadrupled. How long the world’s reserves will last, given this trend, is a matter of debate. As the planet’s population continues to climb—it recently reached eight billion and is expected to hit nine billion in fifteen years—more and more people will need to be fed. At the same time, as the best-grade ores get mined out, more and more rock will presumably have to be processed just to hold fertilizer production steady. Some researchers say that “peak phosphorus,” the point at which the amount of phosphorus being pulled from the ground starts to decline, could be reached within the next decade. Others maintain that the time frame is more like centuries.

Egan doesn’t think that the world will run out of phosphorus anytime soon, but he does argue that the U.S. is “particularly vulnerable.” America is rapidly churning through its domestic reserves, which aren’t all that large to begin with. (Much of the country’s phosphorus is found in central Florida, a region where mining has to compete with condo development.) When these reserves are gone, potentially within the next thirty years, the U.S. will become dependent on other countries—notably, Morocco—to feed itself.

This, it seems, would suit Morocco just fine. The country seized large swaths of Western Sahara in 1975, after Spain, which had ruled the region for almost a century, relinquished control. The invasion, Egan writes, was primarily “a business move.” Morocco has its own huge phosphorus operations, and it didn’t want the Bou Craa mine competing with them. Tens of thousands of the territory’s residents fled; most of them settled in Algeria, where their children and their children’s children still live in refugee camps. In November, 2020, the Polisario Front, a group fighting for independence for Western Sahara, declared that it was ending a ceasefire that had been brokered by the United Nations. A month later, Donald Trump, in one of his last acts as President, announced that the U.S. would recognize Morocco’s sovereignty over the region. The decision was criticized as a violation of international law, and many U.S. officials urged Joe Biden to reverse it. So far, though, he hasn’t.

On September 1, 2018, a young man named Abraham Duarte was pulled over for speeding in the city of Cape Coral, in southwest Florida. He jumped out of his car and took off. Before him stood some apartment buildings that faced a canal. Duarte ran around the buildings and threw himself into the water. When the police caught up with him, he was having trouble swimming. “I need help!” he cried. “I’m going to die!”

One of the cops sounded sympathetic. “You need to get out of that stuff,” he advised. “Seriously, man, that is going to kill you.” Duarte struggled to make his way back to shore, through a bank of green slime so thick that it made the water look solid. He started to retch. The cops fished him out and cuffed him.

Among his many ill-considered moves, Duarte had flung himself into a toxic algae bloom. The body-cam footage of the incident, released by the Cape Coral Police Department, went viral. Newscasters chuckled over the crime-fighting slime. But the story, which Egan relates in detail in “The Devil’s Element,” is, he argues, “more than a meme. It is an omen.”

On a farm, crop yields increase when phosphorus is applied. Phosphorus that makes its way into lakes, streams, and canals also promotes plant growth. Unfortunately, the aquatic organisms that tend to do best are the kind that no one wants to see around. And so there are two sides to the phosphorus problem—one shortage, the other excess.

In a toxic algae bloom, tiny photosynthetic organisms reproduce explosively, then throw off chemicals that, in addition to nausea, can cause brain and liver damage. And, when the algae die en masse, a fresh hell ensues. Their decomposition sucks oxygen out of the water, creating aquatic dead zones where almost nothing can survive.

At the bright-green center of Florida’s excess-phosphorus problem lies Lake Okeechobee. The lake receives as much as two million pounds of phosphorus a year—about ten times what biologists think it can safely take in—much of it from agricultural runoff. In the summer of 2018, around the time that Duarte took his dive, ninety per cent of Okeechobee’s surface was covered in toxic slime. Water released from the lake, via the Caloosahatchee and St. Lucie Rivers, made so many people sick that Florida’s governor, Rick Scott, declared a state of emergency. Egan visited that summer, hoping to take a boat trip down the Caloosahatchee, but his chosen guide, an ecologist named John Cassani, refused to take him, on the ground that it was too dangerous.

“Things are thoroughly screwed up,” Cassani told him. “Thoroughly.”

Harmful algal blooms, or habs, also plague Lake Erie. Mostly, the blooms interfere with fishing and tourism—dense, stinking slime is a turnoff to visitors—but in 2014 some of the toxins got sucked into Toledo’s public water supply. The city was forced to issue a do-not-drink order to four hundred thousand residents in the area, and Ohio’s governor, John Kasich, activated the National Guard.

Lake Erie’s troubles can be traced to concentrated animal feeding operations, or cafos, that dot the Maumee River watershed, in northwestern Ohio. Millions of cows and pigs in these cafos spend their days converting phosphorus-fertilized soy and corn into phosphorus-laden manure, much of which washes out of the operations and into the water. In Egan’s words, the Maumee now functions “like a syringe” that pumps thousands of tons of phosphorus a year into Lake Erie’s westernmost reaches.

Other lakes that have recently experienced habs include Lake Superior, Lake Champlain, Lake Tahoe, Lake Winnebago, and Seneca Lake. Indeed, Egan writes, “a map of US lakes and rivers suffering from blue-green algae outbreaks today looks like, well, a map of the United States.” And the situation isn’t much better outside the U.S. A few years ago, researchers at Stanford and nasa analyzed three decades’ worth of satellite images to assess the conditions of some seventy large lakes around the globe, including Lake Baikal, Lake Nicaragua, and Lake Victoria. They found that “peak summertime bloom intensity” had increased in two-thirds of them.

Meanwhile, dead zones in the oceans, too, are expanding. These zones—a large one forms every summer in the Gulf of Mexico—are also produced by fugitive nutrients. Scientists warn that, as nutrient loads continue to grow and the oceans heat up, the problem will only get worse. (Warm water holds less oxygen than cold.) A trio of British researchers have speculated that, “if our descendants are heedless,” human beings might produce “large-scale and long-lasting global anoxia”—which is to say, a planet-wide marine dead zone. In the judgment of Stephen Porder, a professor of ecology at Brown and the author of “Elemental: How Five Elements Changed Earth’s Past and Will Shape Our Future” (forthcoming from Princeton), the consequences of this would be so catastrophic as to be unimaginable.

Not long ago, I loaded a jug of urine into the trunk of my car and set off—carefully—for Brattleboro, Vermont. Some of the pee was my own; the rest came from my husband, who likes his contributions to journalism to be recognized.

In Brattleboro, I drove past the county transfer station and turned in at a long, low, shedlike building, which houses a group called the Rich Earth Institute. The institute’s stated goal is “a world with clean water and fertile soil achieved by reclaiming the nutrients from our bodies,” and to this end it promotes a practice known as urine diversion, or, more catchily, peecycling. When I arrived, I asked to use the institute’s rest room. Arthur Davis, who directs Rich Earth’s Urine Nutrient Reclamation Program, explained that it was equipped with four kinds of urine-diverting toilets.

“We have a lot of choices,” he said. “Enjoy.”

Just as livestock excrete phosphorus, so, too, do people. Each year, billions of pounds of phosphorus enter humanity’s collective gut. Most of that flows out again, mainly in the form of urine. “Around sixty per cent of the phosphorus we excrete comes out in our pee,” Davis told me.

The Rich Earth Institute has enlisted a network of volunteers around Brattleboro, who drop off their donations at specially designated depots or, in some cases, pay to have their pee picked up. After it has been pasteurized, the urine is distributed to local farmers. Peecycling can cut down on the amount of conventional fertilizer that the farmers purchase. (Urine contains not only phosphorus but also large amounts of nitrogen and potassium.) At the same time, it keeps nutrients out of the sewage system and, by extension, it is hoped, out of Vermont’s waterways.

“There is no ‘away’ when it comes to nutrients,” Davis said. “We’re always putting them somewhere. So we can either choose to set up systems where we’re reusing them in useful ways or they’re going to go into Lake Champlain and cause all of these problems.”

Davis had arranged for us to meet up with a pair of volunteers in the town of Rockingham, just north of Brattleboro. He grabbed a container that had been sitting under one of the urine-diverting toilets. I poured in the pee that I had brought, and we set off. The peecyclers, Laurel Green and Steve Crofter, were waiting for us at the Rockingham depot, along with a few five-gallon jugs of their output.

“Practicing what we pee,” Green said, when I asked why she became involved with the institute. (During my visit to Vermont, I heard endless pee-related puns; one of my favorites was “Pee the change you want to see in the world.”)

A sign outside the depot read “Help us ensure this program is flushed with success.” Inside, Crofter lowered a pipe attached to a vacuum pump into his and Green’s jugs, which were soon empty. Davis explained that the pee had been sucked into a holding tank. When that was full, the institute would cart off the contents.

On an annual basis, the Rich Earth Institute processes about twelve thousand gallons of urine, which is a lot of pee to truck around and, at the same time, barely a drop in the proverbial bucket. In an average year, New York City residents piss out about a billion gallons; Shanghai residents, three billion. “The scaling-up question—there’s a lot to that question,” Davis acknowledged.

In the final chapter of “The Devil’s Element,” Egan goes looking for ways to address both sides of the phosphorus problem. Peecycling gets a nod, as do techniques for stripping phosphorus from the wastewater that runs through sewage-treatment plants. Manure, too, Egan argues, could be more efficiently harvested for its nutrients; in that way, less phosphorus would end up in lakes and rivers and more in next year’s crops. “The potential benefits to better managing manure are staggering,” he writes.

At one point, Egan consults with Jim Elser, a professor of ecology at the University of Montana and the director of a group called the Sustainable Phosphorus Alliance. Elser tells him that if every bit of manure on the planet were recycled—cows, pigs, and chickens produce some four billion tons annually—it could cut the demand for mined phosphorus by half. Of course, even in this best-case scenario, the problem would be only half solved.

As it happens, Elser has written his own book, “Phosphorus: Past and Future” (Oxford), together with a British soil scientist, Phil Haygarth. The two researchers coin the term “phosphogeddon,” to refer to expanding dead zones and the threat of oceanwide anoxia. Fully addressing the problem, they say, will demand not just recycling nutrients but remaking global agriculture from the ground up.

On the phospho-cheery side, Elser and Haygarth have plenty of ideas about how this might be done. The crop varieties that powered the Green Revolution tend to require lots of “inputs”; new varieties that use phosphorus more efficiently could be bred, at least in theory. In the U.S., something like ten per cent of all fertilizer is applied to corn that’s converted into biofuels. In terms of CO2 emissions, corn-based biofuels are probably worse than gasoline; getting rid of them would thus benefit both the climate and the country’s waterways. Globally, it’s estimated that a third of all food gets thrown away. (In the U.S., the figure may be closer to forty per cent.) Reducing the amount of food waste would reduce the need for phosphorus by a similar proportion.

“It’s clear that there is no ‘silver bullet,’ ” Elser and Haygarth observe. “It’s going to take a ‘silver shotgun blast’ to hit all of the targets that need to be hit.”

How likely is it that the world will mobilize in time for such a “blast”? “We’re not going to sugarcoat it,” Elser and Haygarth write. “There are many in the water quality/phosphorus management communities who think that phosphogeddon is, indeed, where we’re heading and where we will end up. We will confess that, in the dark of night, both of us will often resign ourselves to the fact that our children and grandchildren will suffer these outcomes.”

When Humboldt lugged his sack of bird shit to Europe, it seems safe to say, he had no idea what lay ahead—the wrecking of the guano islands, the Bou Craa conveyor belt, the war in Western Sahara, aquatic dead zones, and, potentially, phosphogeddon. This is the hazard of innovation. Short-term solutions often turn out to have long-term costs. But, by the time these costs have become apparent, it’s too late to reverse course. In this sense, the world’s phosphorus problem resembles its carbon-dioxide problem, its plastics problem, its groundwater-use problem, its soil-erosion problem, and its nitrogen problem. The path humanity is on may lead to ruin, but, as of yet, no one has found a workable way back.