With the news that the Simpsons may be on its last legs, here is our selection of the finest episodes from almost 30 years on the air

With composer Danny Elfman suggesting that The Simpsons could be about to end, here is our pick of the five greatest episodes in the show’s 30-year run.

Treehouse of Horror (season two)

All the Halloween specials have their moments, but the original and best is the first Treehouse of Horror episode. You have to admire the freshness of the format from a show still finding its feet, complete with Marge’s concerned content warning in front of red theatre curtains. The story features the Homer-centric reworking of Edgar Allan Poe’s The Raven, and the Amityville Horror/Poltergeist parody of Bad Dream House. Then there is the genius of Hungry Are the Damned, which introduces long-running alien pair Kang and Kodos and one of the best book title reveal gags of all time. The ultimate Simpsons scarefest.

Marge v the Monorail (season four)

“I’ve sold monorails to Brockway, Ogdenville, and North Haverbrook, and, by gum, it put them on the map!” Lyle Lanley, voiced by Phil Hartman, is the perfect con-man for Springfield, as he foists on them the disastrous and unnecessary monorail, playing on their desire for oneupmanship over neighbouring Shelbyville. Homer gets a chance to be properly heroic and save the day. Plus Leonard Nimoy enigmatically cameos, and it gifts us all The Monorail Song, a call-and-response Gilbert and Sullivan-style number that showed a creative team at their absolute peak.

Lisa the Iconoclast (season seven)

Lisa is set to ruin the town’s bicentennial celebration when she discovers that founder Jebediah Springfield was actually a bloodthirsty pirate called Hans Sprungfeld. But she has a change of heart when she sees how the celebrations are bringing everyone together. This episode also features a cameo from the ghost of George Washington, in the kind of meta-touch that epitomised The Simpsons at its height. On the face of it, a silly story set in Springfield. But when you think deeper, a morality tale emerges about how the whole nation portrays the founding fathers and earliest presidents. And it gave the world the Springfield motto: “A noble spirit embiggens the smallest man.” A perfectly cromulent motto indeed.

22 Short Films About Springfield (season seven)

Sure, there are plenty of other full-length regular episodes you could put into a top five, but 22 Short Films About Springfield gleefully explores one of the things that made the show so great for so long – its supporting cast of instantly identifiable minor characters, all with their own foibles and catchphrases. In this episode, characters like Smithers, Dr Nick, Moe, Skinner, Chief Wiggum and even Bumblebee Man get 60 seconds or so to shine.

Homer’s Enemy (season eight)

Hard-done-by Frank Grimes gets a job at the nuclear power plant, realises Homer is a dangerous lazy idiot, and sets about trying to unmask him for the fool he is. His every plot backfires, heaping yet more adulation on Homer. Grimes’ descent into jealous insanity at the end of the episode is darkly hilarious, as he outlines all the ways that Homer is immortal, and channels the deeply held aggression we surely all share for that one Homer in our workplace. Exquisitely played.

What do you think? Which episodes would you have included? And would you have featured anything from the last few years? Is The Simpsons’ time up? Let us know in the comments below.