The penultimate episode of Game of Thrones’ third season ended in a brutal scene of bloodletting that shocked countless unsuspecting viewers. In what’s dubbed the Red Wedding, both Robb Stark and his mother Catelyn, two leading protagonists from a noble house already wrecked by tragedy, are viciously murdered along with their entourage while feasting in the hall of Westerosi power broker Walder Frey. The betrayal, as Jim Poniewozik wrote, is “heartbreaking” and “horrifying.” It signals the end of the Stark war effort and, with the suddenness of its execution, leaves an emotional desolation at the heart of the Game of Thrones narrative.

It’s easy to understand the anger of so many viewers, some of whom who took to Twitter to rail against the TV show, HBO and George R.R. Martin for killing their favorite characters. The massacre of the Starks is not only a surprise, but also an outrage. As Martin emphasizes in his book, the Starks were guests in the Frey home — upon arrival, they ceremonially ate the Freys’ bread and salt, long considered a guarantee of protection from the host.

The treachery violates ancient customs in Martin’s fictive universe that we keenly, intuitively understand. Laws of hospitality are deeply embedded in all human societies. In the Iliad, the primordial war epic of the West, the Greeks lay siege to Troy after the Trojan prince Paris betrays the welcome extended to him at the court of the King of Sparta by slipping away with the King’s beautiful wife Helen. The rights of guests feature prominently in ancient Biblical scriptures, as well as in the Arthashastra, an ancient Indian treatise from roughly 250 B.C. intended as a proto-Machiavellian handbook for South Asian monarchs.

Martin himself claims to have drawn inspiration for the Red Wedding from an infamous episode in medieval Scotland. In November 1440, the principal men of the Black Douglas clan went to dine with the young King of Scotland at the Great Hall of Edinburgh Castle. They had guarantees of safe passage. Not unlike the realms of Westeros, Scotland then was riven by feuding noble families — and the Douglases happened to be at odds with the royal court and those in league with the King. The dinner seemed a moment for rapprochement until the following, narrated by Martin to Entertainment Weekly, happened:

Then at the end of the feast, [the King’s men] started pounding on a single drum. They brought out a covered plate and put it in front of the Earl [of Douglas] and revealed it was the head of a black boar — the symbol of death.

Most accounts describe the decapitated animal as a black bull, not a boar, but in any event, the slaughter of the Douglases that followed — dubbed the Black Dinner — is scorched into Scotland’s historical memory. Four centuries later, it stirred Sir Walter Scott to pen these lines of doggerel:

Martin also mentions the 17th century Glencoe massacre, where dozens from the highland clan MacDonald were butchered by soldiers they had given shelter from a wintry storm. Scotland is also home, at least in lore, to Macbeth, the grasping noble who murdered his King while the latter slept in Macbeth’s castle. The deed is a stark betrayal of both Macbeth’s obligations as a host and as a thane to the Scottish crown. In the Shakespearean play, it’s an unnatural, hideous act. Says one character of the moment of the regicide: “The obscure bird/ Clamored the livelong night./ Some say the Earth/ Was feverous and did shake.”

Of course, you ought to expect more troubles when owls start interminably hooting and a darkness falls on the land. Ruthless, treacherous violence is rarely forgotten, both by the perpetrators and those loyal to the victims. Macbeth gets his comeuppance. And in Westeros, much more blood will be shed.