Thursday night marks the final episodes of “30 Rock”, Tina Fey’s sitcom about life behind the scenes of a fictional sketch comedy series airing on NBC.

Over its eight seasons, 30 Rock turned Liz Lemon into an iconic character and quote machine, gave a second life to Alec Baldwin’s comedy career, somehow sneaked Tracy Morgan and Judah Friedlander onto a regularly airing network comedy, and made the world safe for critically acclaimed but ratings-challenged sitcoms that nonetheless left a mark on popular culture (two words: “MILF Island”).

Oh, and for some reason, it had a lot of references to hockey. Glorious, seemingly inexplicable references to hockey.

Was it the NBC influence, considering that “30 Rock” aired as the NHL and the parent network were in cahoots?

“No, none at all,” said Jack Burditt, a writer on the show who is now writing for “The Mindy Project” on FOX. “This was something that was born out of the writer’s room.”

Burditt, a Los Angeles Kings fan, said that the references were fostered by the NHL’s cooperation. “I think it helped that the NHL was so much easier to deal with than the other sports,” he said.

Was the cast filled with puckheads?

“Tina did talk about the Flyers. Her dad was a Flyers fan. I’ve heard Tina talk more about hockey than anybody else,” he said. “Alec talked mostly about football. [Jack] McBrayer is from the south, so ...”

Hockey just seemed to fit thematically. “30 Rock” was a show that had the admiration of a hardcore group of fans and media, but never could take the next step up in popularity, like, for example, its timeslot competitor “The Big Bang Theory” had.

“We talked about a lot of that the last few months of filming. That it was the seventh season and we got to do it this long. Especially the first couple of years, we always thought we would be cancelled,” he said.

Here’s a look back at some of the more prominent hockey moments and themes from “30 Rock”, with Jack Burditt explaining where the heck they came from ...

As a primer, here’s a NY Mag collection of hockey references on “30 Rock”:

The New York Islanders

One NHL team has been featured prominently throughout the run of ’30 Rock’: the New York, soon-to-be-Brooklyn Islanders.

JACK BURDITT: “It all started with Liz’s dirtbag ex-boyfriend Dennis Duffy, who just seemed always contrary to everything. So of course he would be a big hockey fan. If you live in Manhattan, it’s natural you’re going to be a Rangers fan. No, Dennis is going to be an Islanders fan instead. It’s perfect. He’ll always be wearing the jersey, he would probably be getting in fights constantly every day.

“Being a Rangers fan just seemed too easy for Dennis Duffy."

“In Season 2, when he had a hero moment and rescued someone in the subway, we were in the writers’ room and asked what Dennis Duffy would do if he were a hero. The very first thought: He would spend a day with the Stanley Cup. That’s what the guy would do. Walk around with the Cup as long as he could.

“We ended the episode finding out that he lost the Stanley Cup on a water taxi.”

Paul Giamatti was also an Islanders fan when he appeared as a TV editor in Season 5. In fact, he wore a John Tavares jersey and attended Islanders fantasy camp.

“I think that was another ["30 Rock" show runners] Robert Carlock bit. I forgot that was the Islanders, too."

The Stanley Cup

The “Subway Hero” episode of ’30 Rock’ featured the Cup, as Dean Winters’ character Dennis Duffy earned the chance to carry the Chalice as a local hero.

BURDITT: “We’ve had a lot of celebrities on the show. Constantly. The day the Stanley Cup was there, the buzz was so much bigger than for most of the stars that came through. Everyone wanted their picture taken with it. It’s the greatest trophy in all of sports.”

Story continues