This indigo-blue fabric is the oldest ever found. (Lauren Urana/George Washington University)

Indigo dye may be older — and more American — than previously assumed. In a study published Wednesday in Science Advances, researchers report scraps of indigo-dyed fabric found in Peru that dated back to 6,200 years ago. That makes these blue jean ancestors nearly 2,000 years older than the previous oldest example of the dye, which was made in Egypt.

When researchers first examined the fabric samples, found at a site called Huaca Prieta, they were so dirty they appeared colorless. Even after careful cleaning, their blue stripes are only just barely visible.

"You could see blue in some of the samples but they were mostly gray. You know how your blue jeans fade over time? Well, these were like 6,000-year-old blue jeans," George Washington University anthropologist Jeffrey Splitstoser, the study's first author, told National Geographic. It took chemical analysis to confirm that the fabric contained compounds associated with blue dyes.

Making this particular blue hue is no easy task. Most modern blue fabric is produced using synthetic dye, but ancient Peruvians had to extract the color from natural sources. Plants in the genus Indigofera were likely used to make Peruvian blues, but dyeing with these plants isn't as simple as throwing some fabric in a bubbling blue vat of flower soup: The blue component doesn't dissolve in water, so you can't just rely on water to leach the color out and transfer it to fabric. Instead you have to ferment the plant, then dye fabric with the resulting liquid. And even that part is far from intuitive.

“It’s actually kind of a yellowish color,” Splitstoser told the Los Angeles Times. “In order to get the blue, you dip the clothes in the water with the dissolved indigo molecule, then when you pull it out it oxidizes, and that’s when it turns blue.”

Splitstoser believes the fabric, cut into squares long ago, may have been used to carry offerings to Huaca Prieta, which is thought to have been the site of religious ceremonies. Whatever the purpose of the fabric — or the significance of its blue stripes — the fact that the dyeing process took place at all speaks to some incredibly advanced textile production.

"Some of the world's most significant technological achievements were developed first in the New World," Splitstoser said in a statement. "Many people, however, remain mostly unaware of the important technological contributions made by Native Americans, perhaps because so many of these technologies were replaced by European systems during the conquest. However, the fine fibers and sophisticated dyeing, spinning and weaving practices developed by ancient South Americans were quickly co-opted by Europeans."

"We always leave them out," he told Live Science. "I think this finding just shows that that's a mistake."

Read More:

Surprising ancient beer recipe revealed by Chinese pottery shards

This cute, colorful dinosaur wore brilliant camouflage

Meet the scientist who dreams of fixing your sleep

This new plastic fabric could make clothes that keep you cool