HBO’s most popular show of all time, “Game of Thrones,” didn’t quite set a series record Sunday, but it came close as it wrapped its fourth season.

According to Nielsen in-home viewing estimates, the 9 p.m. telecast — which went head to head with the NBA Finals on ABC in most of the country — averaged 7.1 million viewers, up from the previous week (6.95 million) but not quite as big as the series’ previous high of 7.195 million on May 18. It was up a big 32% from last year’s finale (5.39 million) and more than doubled its first-season finale (3.04 million in 2011).

Two encore airings padded the nightly total for “Game of Thrones” to 9.3 million.

Sunday’s finale continued the show’s remarkable ratings growth, as “Thrones” became the rare series to increase its audience for three consecutive seasons. Its initial 10-episode season averaged 2.52 million same-night viewers, a total that swelled to 3.80 million in 2012, 4.97 million in 2013 and 6.8 million for its 2014 run.

Earlier this month, HBO reported that “Game of Thrones” had become the most popular series in the network’s history. According to Nielsen, episodes of the show that premiere on Sunday night go on to attract an average gross audience of 18.6 million viewers once replays, DVR playback and viewing on other platforms is included.

The previous high for an HBO series, set by the 2002 season of “The Sopranos” (in the pre-DVR era) was an average gross audience of 18.2 million viewers per episode. Season three of “Game of Thrones” had an average gross audience of 14.4 million viewers per episode.

The show’s fourth-season premiere in April drew a then series-record 6.635 million same-night viewers for its initial telecast — the largest same-night audience for any HBO program since the finale of “The Sopranos,” which drew 11.9 million in 2007. The highest in recent years had been 5.53 million for “True Blood” in August 2011.

“Thrones” went on to top that number with six of its final eight episodes.

Based on the bestselling fantasy book series by George R.R. Martin, “Game of Thrones” is an epic story of treachery and nobility set on the continent of Westeros, where summers and winters can last years, and only the lust for power is eternal. In April, two days after its fourth-season premiere, “Thrones” was renewed for seasons five and six.