In the fall of 1457, villagers in Savigny, France witnessed a sow and six piglets attack and kill a 5-year-old boy. Today, the animals would be summarily killed. But errant 15th-century French pigs went to court. And it wasn’t for a show trial—this was the real deal, equipped with a judge, two prosecutors, eight witnesses, and a defense attorney for the accused swine. Witness testimony proved beyond reasonable doubt that the sow had killed the child. The piglets’ role, however, was ambiguous. Although splattered with blood, they were never seen directly attacking the boy. The judge sentenced the sow to be hanged by her hind feet from a “gallows tree.” The piglets, by contrast, were exonerated.

Such a case might seem bizarre to modern observers, but animal trials were commonplace public events in medieval and early modern Europe. Pigs, cows, goats, horses, and dogs that allegedly broke the law were routinely subjected to the same legal proceedings as humans. In a court of law, they were treated as persons. These somber affairs, which always adhered to the strictest legal procedures, reveal a bygone mentality according to which some animals possessed moral agency.

Scholars who have explored animals on trial generally avoid addressing this mentality. Instead, they’ve situated animal trials in several sensible (and academically safer) frameworks. The dominant explanation from legal scholars and historians is that, in a society of people who believed deeply in a divinely determined order of being, with humans at the top, any disruption of God’s hierarchy had to be visibly restored with a formal event. Another hypothesis is that animal trials may have provided authorities an opportunity to intimidate the owners of animals—especially pigs—who ran roughshod through the commons. A sow hanging from the gallows was, in essence, a public service announcement saying, Control your pigs or they’ll die sooner than you hoped.

While these explanations go partway toward elucidating animal trials, none of them fully clarify the practice. They hardly explain why citizens went to great pains to create space for humans to judge animals for their actions. Correcting hierarchical order or sending a stern message to animal owners could have been accomplished much more easily and cheaply with summary execution. What the trials strongly suggest is that pre-industrial citizens deemed the animals among them worthy of human justice primarily because they had, like humans, the free will to make basic choices.

Judges routinely considered animals’ personal circumstances before making a legal decision. Take the exonerated piglets in the opening anecdote. The judge deemed them innocent not only on technical grounds (no witnesses came forth to confirm that the piglets attacked), but also because the pigs were immature, and thus poorly positioned to make clear choices. Furthermore, they were raised by a rogue mother, he indicated, and thus unable to internalize the proper codes of conduct for village-dwelling piglets.

Intentions mattered as well. In a 1379 case, also in France, the son of a swine keeper was attacked and killed by two herds of swine. The court determined that one herd initiated the attack while the other joined in afterward. The judge sentenced both herds to death because their evident cries of enthrallment during the melee were said to confirm their expressed approval of it, whether they were directly responsible or not. A sow hanged in 1567 was convicted not only for assaulting a 4-month-old girl, but for doing so with extra “cruelty.”

The content of an animal’s character was also a factor in courtroom deliberations. In 1750, a man and a she-ass landed in court for alleged bestiality. The man was quickly convicted and sentenced to death. The she-ass, however, was exonerated because the townspeople submitted a document to the court noting that the animal was “in word and deed and in all her habits of life a most honest creature.” This popular assessment led the jury to conclude that the ass was the innocent victim of a violent and deviant master. Only domesticated animals were subject to such character examinations—the expectation being that, living among humans, they better understood the difference between right and wrong. When pigs behaved badly in the courtroom—such as by grunting loudly in the prisoner’s box—this lack of composure could count against them during sentencing. (For more on these and other animal trials, see legal scholar Jen Girgen’s fascinating “The Historical and Contemporary Prosecution and Punishment of Animals.”)

What are we to make of this evidence that our ancestors imputed to animals a sense of moral agency? Contemporary responses have been either to mock them as pre-enlightenment rubes (“artifacts of a superstitious and ritualistic culture,” as legal scholar Katie Sykes summarizes this stance) or to dismiss them as sinister masochists who enjoyed watching animals dangle from the gallows because they had, as historian Edward P. Evans put it in 1906, “a childish disposition to punish irrational creatures.” Overlooked by these interpretations is something that, as we increasingly remove animals from public view, becomes harder to appreciate: These people saw aspects of animal behavior that we don’t see anymore. In this sense, these seemingly odd trials have much to teach us about how fundamentally our relationship with animals has changed over time and how, more poignantly, we’ve lost the ability to empathize with them as sentient beings.

People living in preindustrial agrarian societies interacted almost constantly with domesticated animals. Seventeenth-century farming account books suggest that farmers of that era spent up to 16 hours a day observing and caring for domesticated beasts. They watched these animals make choices, respond to human directives, engage in social relationships, and distinguish themselves as individuals with unique personalities. This observational intimacy lasted well into the 19th century, until feedlots and packing plants consolidated the business of animal agriculture, eventually superseding the practices that kept animals and farmers in close and relatively long-term proximity. A change in mentality followed this consolidation. Humans began to think and talk about animals as objects. “The pig,” explained one agricultural manual from the 1880s, “is the most valuable machine on the farm.” Today, with nearly 99 percent of animal products deriving from these “factory farms,” this view of animals-as-objects persists as the dominant perspective.

However, talk to the 1 percent of farmers who work on small farms and maintain traditional agricultural practices, and they’ll tell you stories that evoke the premodern view of animals. Cheri Ezell-Vandersluis, a former goat farmer, has written that she was so charmed by her animals’ individual qualities that she started to think of them as “part of the family.” Another small-scale goat farmer in California writes that each of his goats “has a personality and I care about each of them as individuals,” and notes that he feels a “twinge” when he takes them to slaughter. A heritage pig farmer in Homosassa, Florida writes, “[T]hey are amazing animals. Each one has its own personality. Little pig Marshall (the boar) is a water hose fanatic. It’s like watching a 3 year old playing in the sprinkler in the front yard.”

And the modern field of animal ethology confirms that farm animals, especially pigs, are fiercely smart. In the most recently publicized study confirming their rare cognition, pigs were shown to be able to use mirrors as tools in their search for food; in other studies, pigs have quickly learned new tasks (like playing videogames), displayed a prodigious memory for where food is stored, and even manipulated one another in a bid for food. The New York Times, referring to this kind of research, editorialized, “We keep probing the animal world for signs of intelligence—as we define it—and we’re always surprised when we discover it. This suggests that something is fundamentally wrong with our assumptions.”

There is something fundamentally wrong with our assumptions about premodern animal trials, too. Medieval Europeans gave animal agency the benefit of the doubt. We condemn billions of animals to conditions that amount to torture without a trial. Which practice really makes less sense?