Researchers said a glass bottle found during an archaeological dig on a Virginia highway median is believed to be a Civil War era "witch bottle" designed to ward off evil spirits.

The William & Mary Center for Archaeological Research said the bottle was discovered during a 2016 archaeological dig for Civil War artifacts prior to a widening project for Interstate 64 in York County.

Joe Jones, director of the William & Mary Center for Archaeological Research, said the glass bottle was initially thought to be nothing more than a place to store loose nails.

"The Union troops were likely tasked with holding and repairing the fortification whenever they had reason to expect Confederate assault," Jones said. "They were building up a fortification, so we just assumed they needed a place to keep their nails and used a bottle."

He said further research was carried out on the finds from the dig and experts now believe the object was a "witch bottle" used by Union soldiers to ward off evil spirits during the war.

The university said people who feared they were under the influence of dark magic would bury a nail-filled bottle under their hearth with the intention of the heat from the hearth energizing the nails to break a magic spell.

The jug is now believed to be one of less than a dozen witch bottles discovered in the United States. Archaeologists in Britain have documented nearly 200 witch bottle discoveries.

"It's a good example of how a singular artifact can speak volumes," Jones said. "It's really a time capsule representing the experience of Civil War troops, a window directly back into what these guys were going through occupying this fortification at this period in time."