This weekend was a massive one for pop culture nerds everywhere. On the big screen, “Avengers: Endgame” promised the epic finale to one of the most ambitious superhero franchises in modern memory. On the small screen, the third episode of the final season of “Game of Thrones” promised the show’s climactic battle, publicized by the production as one of the longest and most ambitious fantasy battles ever staged. Both this Sunday's “The Long Night” episode and “Endgame” managed to live up to the hype, with a strong final twist — and a few hiccups.

The “Game of Thrones” origin material, “A Song of Ice and Fire,” is what was dubbed “high fantasy” by author Lloyd Alexander, a literary trend that became popular in the 1930s with “At the Mountains of Madness” by H.P. Lovecraft, “The Hobbit” by J.R.R. Tolkien and T.H. White’s retelling of the Arthurian legend “The Once and Future King.” The genre’s rise had a lot to do with the experiences of these authors during World War I, and all featured epic battles as part of their stories’ core. The 1950s publication of Tolkien’s “Lord of the Rings” trilogy along with the “Chronicles of Narnia” books by C.S. Lewis in the wake of World War II cemented the notion that large-scale warfare was a hallmark of high fantasy.

(Spoilers below.)

Both this Sunday's “The Long Night” episode and “Endgame” managed to live up to the hype, with a strong final twist — and a few hiccups.

Martin’s books, which stem directly from this tradition, are no exception. Of the five novels currently published, all have at least one substantial armed conflict either directly or indirectly part of the narrative. True to form, every “Game of Thrones” season at least has skirmishes, if not outright battles. In some cases, the show cheated to fit the budget. Season one’s biggest clash, the Battle of Whispering Wood, followed Shakespeare’s model of keeping the action off-screen. Season two’s Battle of the Blackwater was an impressive episode of naval warfare cobbled together from one darkened strip of beach, a single ship housed in a studio and a lot of CGI.

SIGN UP FOR THE THINK WEEKLY NEWSLETTER HERE

The scale of the battles increased during season four, however, when the budget grew large enough to create a 360-degree practical set upon which to stage the Battle of Castle Black. Season five brought aboard director Miguel Sapochnik for the Hardhome Massacre; Sapochnik added heart and emotional perspective to the spectacle, allowing the viewer to experience the genuine horror of battle. One could argue season six’s Battle of the Bastards, which Sapochnik also directed, was the dry run for this week’s episode. It was a blockbuster-level battle, albeit one that ran out of time and funds somewhere in the middle, causing the scene’s final third to devolve into a sort of improvised collapse.

Sapochnik sat out season seven, which spent a lot of time working out the logistics of aerial warfare led by three full grown dragons. But his return for season eight has been a much-anticipated moment. The Battle for Winterfell sequence boasts a nearly full hour’s runtime of the 80-minute episode, beating out the Battle of Helm’s Deep in“The Lord of the Rings: The Two Towers” by a good 15 minutes. That 44-minute sequence from Peter Jackson’s LOTR trilogy was previously considered the gold standard for this sort of fantasy warfare and will be the standard against which this episode is judged, whether “Game of Thrones” wants it to be or not.

In terms of narrative buildup, the show certainly delivered. The tension ran high from the moment the episode began and ratcheted up quickly. The arrival of Melisandre and her fire talents seemed like a good sign for the heroes defending Winterfell but that hope was extinguished quickly. The dead after all, may be stopped by fire on an individual level, but their strength lies in their sheer numbers.

Really the only big problem with the episode was the unavoidable limitations of television. Large-screen productions are just that, large. The output of light is enough that the darkest scenes are visible. Once the snowstorm that accompanies the Night King wherever he goes kicked in, there were parts of the fight that were so dark they felt visually worthless. That didn’t make the action any less tense from a plot perspective, but it did make it very frustrating for the home viewer.

But the best moments, as in almost all “Game of Thrones” episodes, were the quiet ones. Last week’s episode turned those quiet moments into heartwarming character sketches. Here they became moments of horror, like Arya’s silent scene in the library surrounded by the dead. Theon’s charge at the Night King towards the end, in a moment of self-sacrifice, was also intensely moving, as was Jorah’s quiet battlefield death after the battle was won.

As the final episodes count down, fans have been anxiously awaiting the fates of their favorites. This week’s biggest twist did not involve Jon Snow or Daenerys Targaryen, however. Arya took her assassin’s training and turned it on the Night King, resulting in a rather stunning end to a fight most assumed would be lost. But what will happen now? With prophecies and expectations upended, “Game of Thrones” has pulled off one more twist: With half a season to go, the war appears already won.