Lake Amatitlán is so green that it glows. “It looks like paint,” says Matthew Waters, a paleoecologist at the University of Auburn. Industrial pollution and sewage from Guatemala City trickles down into this valley in the highlands, feeding algal blooms that produce levels of toxic chemicals 100 times higher than the level considered dangerous by the World Health Organization. “It’s one of the densest green, most harmful algal blooms” in the world, says Waters, who studies traces of algae left in soil cores.

Algal blooms such as these pose growing health and environmental concerns. In the Gulf of Mexico, they create dead zones that choke fisheries. Earlier this year, three dogs died after playing in Washington’s contaminated Columbia River. But while algal blooms are often thought of as a modern phenomenon, fed by fertilizers used in industrial agriculture, new research led by Waters suggests that Lake Amatitlán has experienced these blooms before—when it sat at the feet of a much older city.

The findings, published this week in the journal PNAS, could help explain what led the Maya people to leave their massive, ornate cities nearly 1,000 years ago.

By examining 2,000 years of lake bed for characteristic pigments left behind by algae—”the same colors that are in fall leaves,” Waters says—the team could see how the water quality had changed over time. Four distinct periods in the lake’s history emerged. There was a huge spike in algae over the last 80 years, with relatively clean water between 1200 and 1800 CE, and 200 and 450 CE. But 450 to 1200 saw a spike in harmful algae, during a period when the nearby Maya city of Kaminaljuyú was expanding.

“The blooms that the Maya experienced were at least on the order of magnitude” as the present, says Waters.

The team didn’t just find evidence of algal blooms: they also found the associated toxins preserved in the mud. The link between toxins and algal blooms is complicated, because you can have a bloom without toxin, and toxin with only a small bloom. The toxic molecules also degrade over time, so it’s hard to know how poisonous the water actually got. But the remains provide clear evidence that the algal blooms did have some impact on water quality.

It’s possible that this algal uptick was due to the density of the city upriver, which would have produced plenty of sewage. There’s also evidence that runoff from farms increased during the period.

The research emerged out of two related questions. Waters studies records of algal blooms at the bottoms of lakes and other waterways in the Southeast, while his colleague Mark Brenner, a coauthor on the study, studies environmental conditions during the Mayan city-building period. One day, Brenner showed Waters a photo of Lake Amatitlán, who responded “man, we’ve got to do some pigments.”

The lake was clearly prone to developing algal blooms, and a major Mayan city had existed within its watershed. It was the ideal place to ask whether Mayan urban societies had impacted their water quality.

“We showed that the increase in population coincides with the harmful algal blooms,” says Waters, “and that’s a piece of information that we can take to other Maya sites.”

[Related: The Maya dealt with a form of climate change, too. Here’s how they survived.]

The story of the Maya is often framed as one of catastrophic collapse, but that’s not quite right. Maya people continue to live in Guatemala and Mexico, and Maya cities existed up until the Spanish genocide in the mid-1500s. Still, Maya society changed enormously during the thousands of years this study focused on. Around 900 CE, people began to leave many of the larger lowland cities, with their massive pyramids and hundreds of thousands of residents. The process didn’t happen all at once, and played out differently in Lake Amatitlán’s highland region—but it leaves a question: why, and how, would an urban society revert to a rural one?

Ecological factors probably played a role. Previous research has suggested that severe drought may have driven the Maya out of metropolitan areas. Waters and his colleagues argue that in addition to scarcity, the quality of the water may have put cities in peril. 

That matches other recent research from the lowland city of Tikal, home to the biggest known Maya temple complex, and the epicenter of a massive suburban sprawl in the jungle. That study used genetic evidence to pinpoint harmful algae in the city’s aquifer, along with mercury, which likely came from a bright red paint pigment called cinnabar. But not every reservoir was polluted, which suggests that Tikal’s residents might have depended on some for water, and others for decoration.

What that meant for Kaminaljuyú is unknown. Lake Amatitlán was downstream from the city, and it’s hard to say whether the water quality contributed to its eventual decline. Still, it’s clear the question should be asked, and Waters plans to do follow-up investigations in lowland cities soon. “Anthropologists and archaeologists did not know to look for decreases in water quality. That wasn’t even on their radar,” says Waters. “They’re looking for sociopolitical fighting, agricultural decimation, from overworking the land or soil erosion.”

The full story probably has to do with the overlap of all those forces. “We found that the people who lived in the elite district of Tikal actually caused the contamination of their water sources,” says David Lentz, who led who led the Tikal study, and is an anthropologist affiliated with Harvard University’s Dumbarton Oaks museum. And they did it unknowingly. And for me, this all points to a larger situation about human beings. That when we modify the environment, we do it with a specific purpose in mind, but oftentimes there are unintended consequences.”

We don’t know where declining water quality and ecological collapse will lead us, but now we know where it’s gone before.