This post contains spoilers for “Game of Thrones” Season 6, Episode 5, titled “The Door.” To refresh your memory on what happened, check out this week’s “Game of Thrones” recap

“Game of Thrones” finally explained the origin of Hodor’s name in the May 23 episode — unfortunately, that reveal also resulted in one of the show’s most heartbreaking scenes to date, as it became clear that Bran Stark was inadvertently responsible for damaging the stableboy’s mind during his visit to the past.

Even worse, thanks to Bran’s decision to try testing out his greenseer powers without the Three-Eyed Raven’s supervision, both the Raven and Hodor ended up dead (or on the verge of it, in Hodor’s case) as the Night King and his army of Wights converged on Bran’s hiding place and were finally able to cross the magical barriers that previously kept them out, attacking Bran and his allies in full force.

“The cave is a safe place — it’s like if you’re playing tag and your hand’s on the wall, you’re safe from whoever’s ‘It.’ And ‘It’ is the Night King, and he can’t access them as long as they’re in there because of the magic that’s protecting this cave,” executive producer David Benioff explains in a behind-the-scenes video. “But Bran makes a mistake. He’s not the Three-Eyed Raven yet — he doesn’t have control over these visions in the way that the Three-Eyed Raven does. For the first time someone actually sees him in the vision, and that’s the Night King, which is part of the tragic mistake here; if the Three-Eyed Raven had been with him, things would’ve ended much differently. As soon as the Three-Eyed Raven realizes that there is no more time, he’s got to try and upload all this knowledge into Bran.”

“This is happening much, much more rapidly than he thought it was going to happen,” EP Dan Weiss adds of Bran’s stressful transition. “He doesn’t really know what it all means, he doesn’t know what to make of it all, because it’s happening under duress.”

The producers admit that author George R. R. Martin revealed the origin of Hodor’s name to them early on in the adaptation process (meaning that we’re likely to see Hodor’s fate play out the same way in the upcoming fifth book in Martin’s series, “The Winds of Winter”), and that it was just as heartbreaking to them as it was to fans on Sunday night.

“We had this meeting with George Martin where we were trying to get as much information as possible out of him, and probably the most shocking revelation he had for us was when he told us the origin of Hodor, how that name came about,” Benioff recalls. “I just remember Dan and I looking at each other when he said that being like ‘holy s–t.'”

“It was just one of the saddest and most affecting things, even sitting in a hotel room and having someone tell you this was going to happen in the abstract in some way, and that ‘Hold the door’ was the origin of the name Hodor,” Weiss says. “We just thought that was a really, really heartbreaking idea.”

“Game of Thrones” airs Sundays at 9 p.m. on HBO.