A 300-year-old shoe found in the walls of a University of Cambridge building was likely put there to ward off evil spirits.

Maintenance staff found the leather shoe — a men's size 6, by today's measurements — on Aug. 1 while installing electrical cables in a common room at St. John's College, one of the constituent colleges that make up the university. The shoe was found between a chimney and a window, Cambridge archaeologist Richard Newman said in a statement. It was probably placed there during renovations between the end of the 1600s and the middle of the 1700s.

"Given its location, it is very likely that it was placed there to play a protective role for the Master of the College," Newman said. "It may have even been one of his own shoes."

The practice of concealing shoes in walls is a tradition that dates back to at least the 1300s, according to the Northampton Museums & Art Gallery, which keeps a database of nearly 2,000 hidden shoes found since the 1950s. Superstition held that the concealed footwear warded off evil spirits, perhaps because the shoes took on the shape of the owner's foot and therefore were thought to contain a little bit of the owner's spirit. The typical hidden shoe was a child's shoe, well-worn, usually hidden in a chimney, wall or roof. [The Surprising Origins of 9 Common Superstitions]

The Cambridge find was a left shoe measuring about 9.6 inches (24 centimeters) long. It had been worn long enough to wear a hole in the sole, but was otherwise well-preserved. It was found in the Second Court area of the college, in a room where senior academics often eat lunch. The building was completed by 1602, but archaeologists think the shoe was placed later, when the interior was being renovated.

Concealed shoes are an example of apotropaic magic, or magic meant to ward off evil and misfortune. According to a 1997 meeting of the Archaeological Leather Group, concealed shoes have been found in a Swiss monastery and in a Northamptonshire insane asylum. One was found at Hampton Court Palace on the River Thames. Even a few church-builders snuck their superstitions into the architecture: Concealed shoes have been found at Winchester and Ely cathedrals in England and at a Baptist church in Cheshire, according to a 1996 article in Costume.

Shoes aren't the only type of good-luck charm once routinely embedded into walls. In the 1600s and onward, people would sometimes create "witch bottles" by placing hair or urine in a small pottery or glass bottle along with wine, needles or herbs. The bottles would then be hidden in a wall or beneath a floorboard to trap and destroy evil. Even creepier, perhaps, was the northern European tradition of placing a dried-out corpse of a cat inside a wall as a protective talisman.

The St. John's shoe will be placed back in the wall alongside a small time capsule containing a newspaper and coins, according to the college.

"The tradition of leaving coins, or other things, in a wall when we finish work on a building is actually something that we still do today, although not out of superstition, of course. These days it’s more like leaving a signature to say we were here," Steve Beeby, the head of maintenance at the college, said in the statement. "In terms of keeping evil spirits away, though, this shoe seems to have done a good job so far."

Original article on Live Science.