With thousands of people en route to Pamplona, Spain, for the San Fermin Festival, Time published a brief examination of the history of the running of the bulls. While townspeople have suggested that the modern running course dates back to 1776, the tradition didn't start with random people sprinting away from a stampede of deadly horns just for fun.

As TIME reported in 1937, the practice of racing in front of bulls to guide them to their pens or ring was in place before the festival began. It was typically used by cattle herders and butchers attempting to guide bulls from the barges on which they arrived to town, to an enclosure in the middle of the night. It’s not entirely clear when townspeople joined in on the run as a feat of bravery.

Meanwhile, the fiesta of San Fermin was carried on as a religious event intended to honor Pamplona’s first bishop, San Fermin, who was beheaded in France while preaching the gospel in the early the third century. The event was held in the fall, rather than in July. Eventually, as the run became a Pamplona tradition rather than just a thing that butchers did for work, the more religious aspects of San Fermin and the encierro merged.

Head over to Time to read more.

Feature image via Asier Solana Bermejo