Deep in the forests of northwestern Jamaica, a secluded cave has sheltered an unabridged account of the environment since the early Bronze Age. The cave’s inhabitants live in near-total darkness, swarming out to feed at night through a mist of their own urine and retreating back inside to roost. The colony of five thousand or so bats then add to the archived climate record much as their ancestors did before them: by swooping down from the walls and defecating on the cave floor.

“People might think of guano as just a big pile of crap,” says Jules Blais, an environmental toxicologist from the University of Ottawa. But buried in that pile are the secrets of the past.

Guano, a sticky brown paste and a staple in many tropical caves, is a festering compilation of a colony’s droppings, remnants of nearby plants, fruits and insects, as well as the odd fallen bat. Guano piles can reveal exactly what the bats were eating as well as details about the environment the bats were exposed to. Conditions in the soil, water and atmosphere are consumed, processed and left—via the bats’ digestive system—in accumulating layers on the floor, like pages in an ever-expanding book. After years of accumulation, paleoclimatologists can read the details of that record to recreate the environmental conditions of the past.

Despite its usefulness as an environmental indicator—joining the ranks of sediment cores, ice samples and tree rings—ancient guano is hard to find. With its high levels of nitrogen, guano from bats and birds has been harvested through the ages as a natural fertilizer. Wars have even been fought over the stuff: In 1864 a naval conflict broke out between Spain and Peru over the Chincha Islands, covered in guano deposits said to be over thirty meters, or 100 feet, tall. Guano played its part in wars, too. When dried, it contains the necessary ingredients for saltpeter, a key ingredient of gunpowder. During the American Civil War, the Confederate Army mined guano from caves to bolster their supplies.

Blais was part of a team lead by Lauren Gallant, a PhD student at the University of Ottawa, which analyzed a 129-centimeter-long (4.2 feet) guano core extracted (with some difficulty and climbing equipment) from the Jamaican cave. The research team wanted to see if they could detect traces of human activity. Radiocarbon dating put the base of the core at around 4,300 years old, long before the first humans arrived on the island. Gallant’s team then looked for shifts in a range of metals and isotopes—chemical elements with varying numbers of neutrons in their atoms’ nuclei—that could indicate human influence. Their study, published this month in the journal Paleogeography, Paleoclimatology, Paleoecology, presents a strong case that such anthropogenic signals can be identified in cores of guano.

The lead levels in the guano core experienced a sharp uptick after 1760, as the fingerprint of coal combustion that propelled the Industrial Revolution began impressing into the atmosphere. Zinc and mercury levels followed suit, rising around the same time. The team could even identify the environmental impacts of much older civilizations, as mercury’s fingerprint first appeared around 1400 B.C., when mining of cinnabar, a reddish-tinged mercury ore, became fashionable among pre-Incan societies in the central Peruvian Andes.

“I was actually shocked at the concentrations of metals that we observed,” Gallant says.

As metals revealed the impact of industry, the composition of certain stable isotopes—a useful proxy for the plant varieties in the bats’ diet—revealed the evolution of agriculture in the region. When the Taíno people first arrived on the island in 650 B.C., they planted maize, represented in the guano by a rise in the isotope carbon-13. The arrival of Christopher Columbus in the early 16th century brought disease and death, but also sugarcane. Either the bats or their prey seem to have been quite partial to a nearby plantation, which pushed carbon-13 levels in the guano higher still. Shifting levels in nitrogen isotopes revealed the introduction of manure-based fertilizers around 3,000 B.C., and later the transition to synthetic fertilizers with less nitrogen toward the end of the 19th century.

“It became a nice little puzzle and history lesson, looking at how agricultural changes had shaped what the bats were exposed to,” Gallant says.

As technology progressed, so too did the signals. Cesium-137, a radioactive isotope produced uniquely from above-ground nuclear weapons testing, peaked in the early 1960s, just as the Cuban Missile Crisis was unfolding and nuclear war seemed imminent.

“It really is a remarkable change in the chemical record that the researchers show,” says Chris Wurster, an environmental geochemist from James Cook University who was not involved in the research. Because tropical records are so hard to find, he says, bat guano might represent one of the best environmental proxies available in many parts of the world.

Guano cores can also offer higher resolution information about environmental changes than stalagmites or lake sediment cores, says Daniel Cleary, a molecular biologist at the Pacific Northwest National Laboratory, as radiocarbon dating is easier to perform with high precision in guano. Bats are also consistently adding to the record, often roosting in the exact same spot in the cave. “You’re getting annual deposition of guano for a long period of time,” he says.

Older bat guano deposits have been studied from caves in Romania, Kurdistan and the Philippines, some dating back hundreds of thousands of years. “We should be treating these like ancient historical accounts, holding key information about the past,” Blais says.

Guano deposits may also contain valuable genetic information about the bats, and although most prehistoric piles seem to have disappeared, some timescales could go back millions of years. Ancient guano could be sitting beneath new layers in undiscovered caves, waiting to offer up secrets—not just of environmental history but about the evolution of bats themselves.