Maya Blue on an ancient Maya mural. Scientists have solved the mystery of how the Maya concocted this pigment.

Ancient Maya would paint unlucky people blue and throw them down a sacred well as human sacrifices. Now scientists have solved the mystery of how to make the famous blue pigment by analyzing traces on pottery left in the bottom of the well.

The Maya associated the color blue with their rain deities. When they offered sacrifices to the god Chaak, they would paint them blue in hopes he would send rain to make corn grow. The blue paint has been found on objects for a long time, but scientists have debated how the Maya created the pigment.

Now Gary Feinman, curator of anthropology at the Field Museum in Chicago, and Dean E. Arnold, a professor of anthropology at Wheaton College, have figured out the secret ingredient in the ancient Maya concoction.

The scientists studied pottery found at the bottom of the well at an important Pre-Columbian Maya site called Chichén Itzá in the Yucatán Peninsula of Mexico. During the Postclassic Period, from around 900 A.D. to 1500 A.D., the Maya would sacrifice people and objects by throwing them into the well, a wide, naturally-formed sinkhole called the Sacred Cenote. Based on studies of bones found at the bottom, it seems most of the human sacrifices were male.

The researchers analyzed a bowl from the cenote that was used to burn incense. The pottery contained traces of Maya Blue. Scientists have long puzzled over how the ancient people created such a vivid, durable, fade-resistant pigment. They knew it contained two substances — extract from the leaves of the indigo plant and a clay mineral called palygorskite.

By examining these pigment samples under an electron microscope, the researchers were able to detect the signatures of its key ingredients.

"Nobody has ever really figured out how those two key ingredients were fused into a very stable pigment," Feinman told LiveScience. "We think that copal, the sacred incense, may have been a third ingredient. We're arguing that heat and perhaps copal resin were the keys to fusing the indigo extract and the clay mineral. And also we have some pretty decent evidence that this was likely taking place at the edge of the cenote."

The copal incense may have been the binding agent that allowed the color to stay true for so long, Feinman said.

"One of the things that’s always been distinctive about Maya Blue is how durable and steadfast a color it is, which is unusual compared to many natural pigments, which fade a lot through time," he said. "This may have been one reason why it was quite so durable."

The scientists think making Maya Blue was part of the sacrifice ritual.

"My guess is that they probably had a large fire and a vessel over that fire where they were combining the key ingredients," Feinman said. "And then they probably took pieces of the hot copal and put them into the vessel."

When the Sacred Cenote was first dredged in 1904, researchers found a 14-foot thick layer of blue residue at the bottom, but didn’t understand its origin. Now, Feinman said, we know it is probably left over from the years' worth of blue-coated sacrifices thrown into the well.

During its heyday, Chichén Itzá was a thriving city. Even after the city collapsed, ancient Maya would take pilgrimages to the site to make sacrifices. Now tourists flock there to see the cenote and a giant step pyramid temple dedicated to Quetzalcoatl. In 2007, it was designated one of the New Seven Wonders of the World by the New Open World Corp.

The new study will be published online Feb. 26 in the British journal Antiquity.