Just in time for National Popcorn Day, a new study says that people in what's now Peru were eating the snack 2,000 years earlier than thought.

Coastal peoples were preparing corn-based foods up to 6,700 years ago, according to analysis of ancient corncobs, husks, tassels, and stalks recently unearthed at the Paredones and Huaca Prieta archaeological sites on Peru's northern coast.

Previously, evidence of corn as a food before about 5,000 years ago had mostly come from what are called microfossils—microscopic remains that do not offer information on the cobs' sizes and shapes.

But the newfound corn remains revealed a lot, via radiocarbon dating and other tests. For instance, the oldest cobs can be identified as popcorn, said study co-author Dolores Piperno, curator of New World archaeology at the National Museum of Natural History in Washington, D.C., and emerita staff scientist at the Smithsonian Tropical Research Institute in Panama.

The people who lived at Paredones and Huaca Prieta would've cooked corn several ways: Wrapping a cob (in an as yet undetermined material) and resting it on coals, roasting a cob directly over a flame, or cooking a cob in an earthen oven, Piperno said.

In this culture, corn was likely a delicacy or a minor supplement to the diet—archaeological evidence shows they did not eat it in large numbers.

Ancient Farmers Experimented With Corn

Corn was first domesticated in Mexico about 9,000 years ago from a wild grass called teosinte, according to Piperno, whose research appears this week in the journal Proceedings of the National Academy of Sciences.

A few thousand years later, corn was brought to South America, where farmers bred the plant crop into hundreds of varieties, she added. (See pictures of modern agriculture.)

Indeed, what surprised Piperno most about the new research was the diversity of corn-from cob shapes to kernel colors—discovered in the newfound remains.