In the wee hours of the morning in a lab in Amherst, Massachusetts, geoscience graduate student Rob D’Anjou sat looking over test results, a pot of coffee nearby. He’d been pulling long days to analyze two narrow columns of silt, mud, and other sediment cored from the bottom of Lake Liland in Arctic Norway, and, frustratingly, was seeing no sign of the molecules with which he’d been hoping to reconstruct the temperature and precipitation records during the lake’s last 7,000-odd years.

There were a number of other substances in the cores, though. And some of those other substances, he realized with a jolt, looked familiar. He turned to a cache of chemistry papers and, with their help, confirmed his suspicion: He was looking at human fecal sterols, the last chemical hurrah of poop. And these feces were decidedly ancient ones, manufactured, as it were, starting more than 2,000 years ago.

D'Anjou knew that the find, however unglamorous it might be, was an important one. Human fecal sterols are, by definition, indicators of the presence of human beings and may provide a way to track the migration of ancient peoples, as well as to help paleoclimatologists assess those populations' effects on the environment. When he presented his data before the geosciences department at University of Massachusetts, Amherst, the scientists in the audience were quick to suggest colorful titles for his study. But D'Anjou and his colleagues spent the following couple years giving the samples a far more sober kind of consideration. Their work, published this week in the Proceedings of the National Academy of Sciences, marks the first time fecal sterols have been used this way, but it more than likely won't be the last.

A timeline of waste

Lake sediments have long been a rich trove of clues to ancient human history—but often only indirectly so. Paleoclimatologists have probed ancient silt for grains of crop pollen and charcoal from fires, for instance, in attempts to say definitively whether and when human beings were on the scene. But pollen can blow in from miles away, and fires occur naturally, making such techniques, even when used in combination, fuzzy at best.

That’s in part why such a lengthy record of defecation excited D’Anjou. Fecal sterols, produced in the guts of mammals during the digestion of cholesterol, are familiar to science. Different mammal species produce slightly different flavors of sterols, and they have been used by archaeologists to determine whether ancient farmers used manure on their fields and to pinpoint the location of long-ago latrines. Modern environmental scientists also use them to detect sewage contamination in deltas and estuaries. No one, though, seemed to have looked for sterols in a sediment core before.

The first thing D'Anjou did was to create a timeline of the precise level of the sterols at different depths of the cores—which correspond, of course, to different points in time. Then he assembled timelines of two other substances in the cores: polycyclic aromatic hydrocarbons, which are released when plant matter is burned, and plant waxes, which allow paleoclimatologists to deduce whether nearby land was forested or cleared, presumably for farming.

When these plots were all put next to one another, along with temperature data from tree rings, D'Anjou saw a story emerge. For the first 4,000 or so years of the record, human fecal sterol levels were nearly zero, and the levels of the hydrocarbons were low too. The plant waxes suggest that the land was forested. Then, about 2,250 years ago, the sterol and hydrocarbon levels spike dramatically, and a greater proportion of the land was cleared. The levels of fecal sterols remain elevated for hundreds of years, often falling after a sudden temperature drop, which might have made agriculture untenable in the already-chilly Arctic. Sterol levels rise again when the temperature warms, but a significant dip occurs around 550 AD, continuing gradually downward, in tandem with records of migrations in Scandinavia, mostly for political and socioeconomic reasons. Levels later recover, but another dip occurs around the time of the Black Plague in the 14th century, when historical records show that more than 80% of the area's farms were abandoned.

One man's trash...

It’s a compelling story and the scientists did a commendable job of assembling it, according to Ted Van Vleet, an emeritus professor of chemical oceanography at University of Southern Florida who has used fecal sterols to study sewage pollution. “There are maybe other interpretations, but the scenarios that the authors present [are] solid,” he wrote in an email.

Still, D'Anjou and his team readily acknowledge the possibility of those other scenarios. Just because sterol levels drop, they concede, doesn’t necessarily mean there was an equivalent drop in the human population. “If it got a lot wetter, and there was more transfer of material from wherever they were pooping, that kind of uncertainty is definitely there,” says climatologist Ray Bradley, D’Anjou’s advisor.

But, Bradley points out, the fecal sterol signal appears to be extraordinarily sensitive. Further back in history, when human sterols were almost completely absent, the team still saw small amounts of the kinds deposited by grazing animals. “We were able to detect that, which is really amazing,” Bradley says. “There couldn’t have been that many moose and deer wandering about. But nevertheless that signal was detectable in the sediments.” That suggests that the magnitude of the error, in most cases, might not be very large.

Going forward, the team hopes to sample nearby lakes to see if fecal sterols are preserved there too, and to team up with archaeologists to see if sterols in sediment cores elsewhere can help answer questions of when humans arrived on the scene in places in like Polynesia. One member of the current team, however, adjunct professor of geoscience David Finkelstein, is planning experiments closer to home. Interested in how fresh poop versus aged poop shows up in the chemical record, he has made calls to local farms to see about getting specimens for weathering studies. He has already encountered some skepticism.

“'Are you guys serious?' That's always the question on the other end of the phone,” he says. His answer: “'Yes, sir, we are serious about our poop here.'”

This story also appears at TIME.com.