Photo: ABC

Twenty-four years ago this summer, ABC aired one of the most shocking and unexpected finales in TV history. You’d be forgiven for not knowing that, though: It aired in the same programming block as Full House and Family Matters, it was a show about anthropomorphic dinosaurs, and it foretold the end of the world.

The show was called Dinosaurs, and it was essentially an inverse of The Flintstones. A sitcom set in prehistoric times, it followed a family of dinosaurs that used technology, got married, had kids, and went to work, all while humans lingered around as stupid creatures worthy of ridicule. But in its finale, the show’s creators twisted that premise to give a grave warning: Driven by ignorance and greed, the dinosaurs accidentally spark an Ice Age that causes worldwide extinction.

When Dinosaurs first premiered in 1991, the Jim Henson Productions series was a hit for ABC and its TGIF programming block. (It even spawned a catchphrase for its breakout character: “I’m the Baby, gotta love me!”) But as the show got shuffled into different time slots, its ratings took a dive. The huge cost of puppetry production didn’t help, according to Stuart Pankin, who voiced Earl, the head of the Sinclair family. “I heard it was the most expensive half-hour TV show, at least at that point, because of the maintenance of the animatronics,” he said. “In the end, it wasn’t worth it for them.”

Series co-creator Michael Jacobs says that the writers got word of the show’s cancellation in advance, so they planned the fourth season knowing it would be their last. “From the moment we first talked about the show, we discussed the idea that it was the domestication of these dinosaurs that made them go extinct,” he said. “The thing that human beings knew about dinosaurs was that, in the end, they were extinct, so we always had that idea in the back of our minds. The show would end by completing the metaphor and showing that extinction.”

The series finale, “Changing Nature,” opens with the Sinclair family gathering to watch the annual migration of the Bunch Beetles, a species of bug that eats local vines. The beetles never show up, though, because their swamp breeding ground was paved over by WESAYSO, an all-powerful corporation that constantly does things that are good for business, but terrible for the planet. “My writing partner Bob Young and I decided that the end of the dinosaurs should come from the lowest possible form of creature,” Jacobs said. “We felt that the metaphor in the episode had to be that we, as humans, may be utterly unaware of what will come to get us if we are not vigilant.”

With the beetles gone, the vines grow out of control and obstruct WESAYSO factories. Earl’s boss, B.P. Richfield, puts him in charge of a project to spray the planet with a defoliant meant to kill the vines, but the defoliant quickly kills all plant life entirely. The problems balloon from there: Richfield decides that the plants will grow back if it rains, and drops bombs into volcanoes so that the eruptions will create clouds. This fails spectacularly, and it starts snowing heavily across Pangea. Still, Richfield scoffs at the news reports that they blocked out the sun for tens of thousands of years — because the cold weather led dinosaurs to flood WESAYSO stores for heaters, blankets, and hot cocoa mix, giving the company its best third-quarter ever. When Earl points out that the world may still come to an end, Richfield keeping counting his money and calls it a “fourth-quarter problem.”

“We certainly wanted to make the episode to be educational to the audience,” Jacobs said. “If the show has any value at all, it is young people have to understand that extinction is a possibility, so that they can remind their parents that if they are not taking care of the world for themselves, they should do it for the children.”

The show’s last scene sees Earl finally realizing what he has done: By sucking up to his boss and agreeing to spray the world with poison, he’s doomed everyone to an Ice Age. He apologizes to the family and admits he shouldn’t have taken nature for granted as he tries to comfort the Baby. “I’m sure it’ll all work out okay,” Earl says, as the family huddles in warm clothes. “After all, dinosaurs have been on this earth for 150 million years. It’s not like we’re going to just … disappear!” The series ends with local anchorman Howard Handupme signing off, and a shot of the Sinclair home being covered in snow.

Photo: ABC

Pankin, who voiced Earl, thinks the power of the finale is in what it doesn’t show. “There’s subtlety in the way it ended with the snow. It was a simplistic and heartfelt social comment, yet it was very powerful,” he said. “I am very proud of my performance in that scene, and [Dinosaurs producer Kirk Thatcher] writing that speech to the family. That scene is the harrowing moment of the episode, the arrogance of man who believes he is going to be around forever.”

“Changing Nature” was certainly shocking, but it wasn’t the show’s first foray into heavy imagery and serious subjects. From workplace sexual harassment to masturbation and sexual awakening to homosexuality and homophobia, Dinosaur took aim at a lot of taboo subjects before it killed all its characters in that climate-change apocalypse. “[ABC] wanted us to take shots at these subjects, because it made a lot of noise and got people talking,” said Jacobs. “After the initial success of the show, they pretty much left us alone, especially after the Baby became a hit. As long as the Baby hit his father over the head with a pot, we could use that to hide anything.”

But when it came time to kill all the dinosaurs, the network wasn’t as happy. One morning, Jacobs got a call from ABC’s then-president, Ted Harbert. “He said, ‘Where do you even come up with the idea that you can destroy this entire cast in the last episode?!’” Jacobs recalled, laughing. “I said, ‘Well, Ted, it’s not the cast that we are trying to destroy, it’s the entire world. My source for doing this is history!’ He thought about it for about 30 seconds on the phone, in silence, and said, ‘Okay.’ When you do a show about dinosaurs, you always have that extinction card in your pocket, and we wanted to use it.”

Despite the shocking conclusion, Pankin doesn’t recall much anger among viewers. “Everybody was at first shocked, but I think it was more of a reaction to the show ending. There was a lot of sadness about it being over,” he said. Jacobs, meanwhile, got letters from upset parents who got the message. “They understood the creativity in the final episode, and they were sad at the predicament we presented in the story. … If the show had aired today, it would have caused an immediate social-media storm.”

The Dinosaurs series finale is available to stream on Hulu.